Closed jrgonzalezrios closed 9 years ago
Yes, when you add the transport mechanism, you can use your express-hbs instance like so:
var exphbs = require('express-handlebars');
...
var hbs = require('nodemailer-express-handlebars');
transporter.use('compile', hbs({
viewEngine: exphbs,
...
));
Hi! I am trying to use a helper to format the date in a email, I tryed this:
var exphbs = require('express-handlebars');
exphbs.create({ // Specify helpers which are only registered on this instance. helpers: { formatDate: function (dateTime) { return moment(dateTime).format('lll '); }
} });
It throws a: Missing helper error. Could you help me how to apply this kind of helper?
Thanks!