-
Notifications
You must be signed in to change notification settings - Fork 40
Not working with .hbs View engine #8
Comments
Did you specify the engine like so? new Email('sometemplate.hbs', {
engine: require('handlebars'),
}).send(); (excuse any typos and the contrived example, am in the train) |
@mxstbr I'll try that, but works well with ejs |
@mxstbr still not working with Handlebars even when define the engine |
Can you please show us the code you use? It's really hard to debug with just your explanations 😉 |
I had the same issue. I couldn't get the Here's what works for me: var Email = require('keystone-email');
var hbs = require('hbs');
templateLocals.layout = false;
new Email('./templates/emails/template.hbs', {
transport: 'mailgun',
engine: 'hbs',
})
.send(templateLocals, sendOptions, function (err, result) {
if (err) {
console.error('🤕 Mailgun test failed with error:\n', err);
} else {
console.log('📬 Successfully sent Mailgun test with result:\n', result);
}
}); |
Hey @ChrisLah thank you for this helpful snippet. Did you replace Is Thanks again :) |
I installed Happy to help (: |
Why after more than 2 years we still must use these hack to use keystone-email with handlebars? 😮 |
Also having this problem. I need to fix this TODAY for a project at work. :( I am getting
|
I made this work using the example on the readme, but isn't working with a .hbs template.
I installed the latest version of handlebars and express-handlebars.
I'm using Keystone with handlebars view engine, however I can't feel comfortable with pug.
Any workaround this ?
The text was updated successfully, but these errors were encountered: