nodemailer-express-handlebars
Advanced tools
Comparing version 4.0.0 to 5.0.0
@@ -20,11 +20,21 @@ 'use strict'; | ||
var templatePath = path.join(this.viewPath, mail.data.template + this.extName); | ||
var textTemplatePath=''; | ||
if (!!mail.data.text_template) { | ||
textTemplatePath=path.join(this.viewPath, mail.data.text_template + this.extName); | ||
} | ||
var viewEngine=this.viewEngine; | ||
this.viewEngine.renderView(templatePath, mail.data.context, function(err, body) { | ||
if (err) return cb(err); | ||
mail.data.html = body; | ||
cb(); | ||
if(!mail.data.text_template)cb(); | ||
else{ | ||
viewEngine.renderView(textTemplatePath, mail.data.context, function(err, body) { | ||
if (err) return cb(err); | ||
mail.data.text = body; | ||
cb(); | ||
}); | ||
} | ||
}); | ||
}; | ||
module.exports = TemplateGenerator; | ||
module.exports = TemplateGenerator; |
{ | ||
"name": "nodemailer-express-handlebars", | ||
"version": "4.0.0", | ||
"version": "5.0.0", | ||
"description": "A plugin for nodemailer that uses express-handlebars view engine to generate emails", | ||
@@ -24,3 +24,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"express-handlebars": "^4.0.0" | ||
"express-handlebars": "^6.0.0" | ||
}, | ||
@@ -27,0 +27,0 @@ "devDependencies": { |
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
6747
128
+ Addedbrace-expansion@2.0.1(transitive)
+ Addedexpress-handlebars@6.0.7(transitive)
+ Addedglob@8.1.0(transitive)
+ Addedminimatch@5.1.6(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedexpress-handlebars@4.0.6(transitive)
- Removedglob@7.2.3(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
Updatedexpress-handlebars@^6.0.0