Create, preview (browser/iOS Simulator), and send custom email templates for Node.js. Made for @forwardemail, @ladjs, @cabinjs, @spamscanner, and @breejs.
This if statement at the end of renderAll won't properly throw an error, because message.attachments might never have been defined (because of: _.isArray(message.attachments))
if ( (!is.string(message.subject) || is.emptyStringOrWhitespace(message.subject)) && (!is.string(message.text) || is.emptyStringOrWhitespace(message.text)) && (!is.string(message.html) || is.emptyStringOrWhitespace(message.html)) && _.isArray(message.attachments) && _.isEmpty(message.attachments) ) throw new Error( No content was passed for subject, html, text, nor attachments message props. Check that the files for the template "${template}" exist. );
Because of this, even if renderAll is called with an invalid templates path, and no message is constructed because no rendering was done, the error is not thrown.
This if statement at the end of renderAll won't properly throw an error, because message.attachments might never have been defined (because of:
_.isArray(message.attachments)
)if ( (!is.string(message.subject) || is.emptyStringOrWhitespace(message.subject)) && (!is.string(message.text) || is.emptyStringOrWhitespace(message.text)) && (!is.string(message.html) || is.emptyStringOrWhitespace(message.html)) && _.isArray(message.attachments) && _.isEmpty(message.attachments) ) throw new Error(
No content was passed for subject, html, text, nor attachments message props. Check that the files for the template "${template}" exist.);
Because of this, even if renderAll is called with an invalid templates path, and no message is constructed because no rendering was done, the error is not thrown.