Closed mcajkovs closed 3 years ago
You have to set the views option (see https://github.com/forwardemail/email-templates#custom-template-engine-eg-ejs).
Change you code to this:
const email = new Email({
message: {
from: 'niftylettuce@gmail.com'
},
// uncomment below to send emails in development/test env:
// send: true
transport: {
jsonTransport: true
- }
+ },
+ views: {
+ options: {
+ extension: 'hbs' // <---- HERE
+ }
+ }
});
I've created similar structure as stated in documentation but I've added handlebars template into it:
Content of those hbs files is following:
html.hbs
subject.hbs
My code is copied from mentioned documentation (except for
mars
template I'm usingvenus
):I've installed both pug and handlebars:
npm install email-templates pug handlebars
mars
template is working fine, but when I try to usevenus
I get following errorwhat I'm doing wrong? Thanks