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,
|
toArg: string,
|
||||||
dataArg = {}
|
dataArg = {}
|
||||||
) {
|
) {
|
||||||
const message = {
|
const message: plugins.nodemailer.SendMailOptions = {
|
||||||
from: smartmailArg.options.from,
|
from: smartmailArg.options.from,
|
||||||
to: toArg,
|
to: toArg,
|
||||||
subject: smartmailArg.getSubject(dataArg),
|
subject: smartmailArg.getSubject(dataArg),
|
||||||
text: smartmailArg.getBody(dataArg),
|
text: smartmailArg.getBody(dataArg),
|
||||||
html: 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);
|
const response = await this.nodemailerTransport.sendMail(message);
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user