mail-time
Advanced tools
Comparing version 1.0.5 to 1.0.6
22
index.js
@@ -310,3 +310,3 @@ const JoSk = require('josk'); | ||
if (findUpdateError) { | ||
this.___handleError(task, findUpdateError); | ||
this.___handleError(task, findUpdateError, {}); | ||
return; | ||
@@ -343,6 +343,11 @@ } | ||
if (error) { | ||
this.___handleError(task, error); | ||
this.___handleError(task, error, info); | ||
return; | ||
} | ||
if (!info.accepted.length) { | ||
this.___handleError(task, 'Message not accepted or Greeting never received', info); | ||
return; | ||
} | ||
this.collection.deleteOne({ | ||
@@ -357,4 +362,4 @@ _id: task._id | ||
if (this.callbacks[_id] && this.callbacks[_id].length) { | ||
this.callbacks[_id].forEach((cb, index) => { | ||
cb(void 0, info, task.mailOptions[index]); | ||
this.callbacks[_id].forEach((cb, i) => { | ||
cb(void 0, info, task.mailOptions[i]); | ||
}); | ||
@@ -371,3 +376,3 @@ } | ||
} | ||
this.___handleError(task, e); | ||
this.___handleError(task, e, {}); | ||
} | ||
@@ -396,3 +401,3 @@ }); | ||
@param opts.template {String} - Template string | ||
@param opts[key] {mix} - Other MailOptions according to NodeMailer lib | ||
@param opts[key] {mix} - Other MailOptions according to NodeMailer lib documentation | ||
@param callback {Function} - [OPTIONAL] Callback function | ||
@@ -504,5 +509,6 @@ @returns {void} | ||
@param error {mix} - Error String/Object/Error | ||
@param info {Object} - Info object returned from nodemailer | ||
@returns {void} | ||
*/ | ||
___handleError(task, error) { | ||
___handleError(task, error, info) { | ||
if (!task) { | ||
@@ -523,3 +529,3 @@ return; | ||
this.callbacks[_id].forEach((cb, i) => { | ||
cb(error, void 0, task.mailOptions[i]); | ||
cb(error, info, task.mailOptions[i]); | ||
}); | ||
@@ -526,0 +532,0 @@ } |
{ | ||
"name": "mail-time", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Bulletproof email queue on top of NodeMailer with support of multiple clusters and servers setup", | ||
@@ -57,5 +57,5 @@ "main": "index.js", | ||
"mocha": "^6.0.2", | ||
"mongodb": "^3.2.4", | ||
"mongodb": "^3.1.13", | ||
"nodemailer": "^6.1.1" | ||
} | ||
} |
53423
690