Open xeroxoid opened 9 years ago
I'm not sure what nodemailer-express-handlebars
is… but move the _compileTemplate
function directly to the instance; e.g.:
var exphbs = require('express-handlebars');
var hbs = exphbs.create({ /* options */ });
hbs._compileTemplate = function (template, options) {
// Do something before.
var compiled = this.handlebars.compile(template, options);
// And/or do something after.
return compiled;
};
You can call
the default implementation of _compileTemplate
if you want, or simply do what I did can call the Handlebars function directly.
Hi! Excellent work with the library (I bet you hear it all the time).
I am trying to inline all the CSS with "juice" before I send out an email with ''nodemailer-express-handlebars". For that I am passing an express-handlebars instance to the nodemailer-express-handlebars and I got a hint from what was said here: https://github.com/ericf/express-handlebars/issues/39#issuecomment-26743921 to override _compileTemplate (previously compileTemplate) in order to do that. It does not seem to work though and I can't seem to find what the matter is. My code is as follows:
Any hints would be awesome and sorry for opening an issue for this (I understand it is more of a question..)