Closed andrew-lp closed 4 years ago
This issue should be filed in the consolidate repo
Sorry to necro a closed issue, but it might be helpful for others wandering here to see a working example without having to comb through consolidate's source as I did.
The answer is to pass helpers inside of the locals
object, like so:
const emailHtml = await email.render(
`${pathToTemplate}/html`,
{
...templateVariables,
helpers: {
isdefined(key) {
return key !== undefined;
}
}
}
)
Hi,
I am unable to find any recent documentation on how to add a custom helper to the handlebar instance used by email-templates
Is this possible on the latest versions?
Thanks