idea-toolbox
Advanced tools
Comparing version 0.8.9 to 0.8.10
10
index.js
@@ -289,3 +289,3 @@ 'use strict'; | ||
sesData.SourceArn = sesParams.sourceArn; | ||
sesData.Region = sesParams.region; | ||
let ses = new AWS.SES({ region: sesParams.region }); | ||
// send email | ||
@@ -296,7 +296,7 @@ if(emailData.attachments && emailData.attachments.length) { | ||
sesParams, sesData, emailData.attachments); | ||
sesSendEmailThroughNodemailer(sesData, emailData.attachments, cb); | ||
sesSendEmailThroughNodemailer(ses, sesData, emailData.attachments, cb); | ||
} else { | ||
// classic way, through SES | ||
console.log('SES send email', sesParams, sesData); | ||
new AWS.SES({ region: sesData.Region }).sendEmail(sesData, (err, data) => { cb(err, data); }); | ||
ses.sendEmail(sesData, (err, data) => { cb(err, data); }); | ||
} | ||
@@ -308,3 +308,3 @@ } | ||
*/ | ||
function sesSendEmailThroughNodemailer(sesData, attachments, cb) { | ||
function sesSendEmailThroughNodemailer(ses, sesData, attachments, cb) { | ||
// set the mail options in Nodemailer's format | ||
@@ -323,3 +323,3 @@ let mailOptions = {}; | ||
// create Nodemailer SES transporter | ||
let transporter = Nodemailer.createTransport({ SES: new AWS.SES({ region: sesData.Region }) }); | ||
let transporter = Nodemailer.createTransport({ SES: ses }); | ||
// send the email | ||
@@ -326,0 +326,0 @@ transporter.sendMail(mailOptions, (err, data) => { cb(err, data); }); |
{ | ||
"name": "idea-toolbox", | ||
"version": "0.8.9", | ||
"version": "0.8.10", | ||
"description": "IDEA's utility functions", | ||
@@ -5,0 +5,0 @@ "engines": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19454