-
Notifications
You must be signed in to change notification settings - Fork 20
Nodejs Email templates
Chakradhar Jonagam edited this page Jun 25, 2015
·
2 revisions
npm install swig-email-templates
mkdir templates
welcome {{name}}
your username is {{uname}}
var path = require('path')
, emailTemplates = require('swig-email-templates')
var options = {
root: path.join(__dirname, "templates"),
// any other swig options allowed here
};
emailTemplates(options, function(err, render) {
var context = {
name: "name",
uname: "debianmaster",
};
render('welcome.html', context, function(err, html, text) {
console.log(html);
});
});