You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Chakradhar Jonagam edited this page Jun 25, 2015
·
2 revisions
install swig-email-templates
npm install swig-email-templates
create templates folder
mkdir templates
create welcome.html inside templates folder
welcome {{name}}
your username is {{uname}}
Generate template using following code -- gen.js
varpath=require('path'),emailTemplates=require('swig-email-templates')varoptions={root: path.join(__dirname,"templates"),// any other swig options allowed here};emailTemplates(options,function(err,render){varcontext={name: "name",uname: "debianmaster",};render('welcome.html',context,function(err,html,text){console.log(html);});});