fix(core): update
This commit is contained in:
parent
c9fd14df8b
commit
0c44743d99
12
ts/index.ts
12
ts/index.ts
@ -31,13 +31,23 @@ export class Smartsmtp {
|
||||
toArg: string,
|
||||
dataArg = {}
|
||||
) {
|
||||
const message = {
|
||||
const message: plugins.nodemailer.SendMailOptions = {
|
||||
from: smartmailArg.options.from,
|
||||
to: toArg,
|
||||
subject: smartmailArg.getSubject(dataArg),
|
||||
text: smartmailArg.getBody(dataArg),
|
||||
html: smartmailArg.getBody(dataArg),
|
||||
attachments: []
|
||||
};
|
||||
|
||||
// lets add attachments from smartmailArg
|
||||
for (const attachment of smartmailArg.attachments) {
|
||||
message.attachments.push({
|
||||
filename: attachment.parsedPath.base,
|
||||
content: attachment.contentBuffer
|
||||
});
|
||||
}
|
||||
|
||||
const response = await this.nodemailerTransport.sendMail(message);
|
||||
return response;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user