refactor: mail services to nestjs

This commit is contained in:
Ahmed Bouhuolia
2025-01-13 16:06:55 +02:00
parent 72818759a5
commit 4ab20ac76a
62 changed files with 1635 additions and 1304 deletions

View File

@@ -1,6 +1,5 @@
import fs from 'fs';
import * as fs from 'fs';
import Mustache from 'mustache';
import { Container } from 'typedi';
import path from 'path';
import { IMailAttachment } from '@/interfaces';
@@ -40,23 +39,6 @@ export default class Mail {
return this.view ? Mail.render(this.view, this.data) : this.content;
}
/**
* Sends the given mail to the target address.
*/
public send() {
return new Promise((resolve, reject) => {
const Mail = Container.get('mail');
Mail.sendMail(this.mailOptions, (error) => {
if (error) {
reject(error);
return;
}
resolve(true);
});
});
}
/**
* Set send mail to address.
* @param {string} to -