klark-js-plugins
Advanced tools
Comparing version 1.0.31 to 1.0.32
{ | ||
"name": "klark-js-plugins", | ||
"version": "1.0.31", | ||
"version": "1.0.32", | ||
"description": "Plugin modules for KlarkJS", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,5 +0,4 @@ | ||
'use strict'; | ||
"use strict"; | ||
KlarkModule(module, 'krkNotificationsEmail', function(_, q, $nodemailer) { | ||
KlarkModule(module, "krkNotificationsEmail", function(_, q, $nodemailer) { | ||
return { | ||
@@ -11,3 +10,3 @@ send: send | ||
if (!(config.emailSmtp && config.emailAddress)) { | ||
throw new Error('Invalid arguments'); | ||
throw new Error("Invalid arguments"); | ||
} | ||
@@ -20,12 +19,17 @@ var to = _.castArray(opts.to); | ||
var from = config.emailName ? '"' + config.emailName + '" <' + config.emailAddress + '>' | ||
: config.emailAddress; | ||
var from = config.emailName | ||
? '"' + config.emailName + '" <' + config.emailAddress + ">" | ||
: config.emailAddress; | ||
var mailOptions = { | ||
from: from, // sender address | ||
to: _.join(to, ', '), // list of receivers | ||
subject: subject, // Subject line | ||
html: content // html body | ||
from: from, // sender address | ||
to: _.join(to, ", "), // list of receivers | ||
subject: subject, // Subject line | ||
html: content // html body | ||
}; | ||
if (opts.attachments) { | ||
mailOptions.attachments = opts.attachments; | ||
} | ||
return q.promisify(function(cb) { | ||
@@ -35,3 +39,2 @@ return transporter.sendMail(mailOptions, cb); | ||
} | ||
}); |
80379
2030