2 Commits

Author SHA1 Message Date
9e44474348 1.0.7 2020-08-15 12:58:02 +00:00
0c44743d99 fix(core): update 2020-08-15 12:58:01 +00:00
3 changed files with 13 additions and 3 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartsmtp",
"version": "1.0.6",
"version": "1.0.7",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartsmtp",
"version": "1.0.6",
"version": "1.0.7",
"private": false,
"description": "a module for handling smtp stuff",
"main": "dist_ts/index.js",

View File

@ -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;
}