mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 05:40:31 +00:00
refactor: mail services to nestjs
This commit is contained in:
@@ -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 -
|
||||
|
||||
Reference in New Issue
Block a user