You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're using handlebars for our email templates, one handlebars file per template. Using Mailgun you can't upload partials and reference them and some of our templates share things like footer. So I'm wondering if there's a good way to compile a new handlebars template which bakes in the partials? I'm figuring I can just do a reg-exp replace but I wanted to check if there's an "official" way of doing so.
I'm wondering if there's a good way to compile a new handlebars template which bakes in the partials
I'm not aware of an easy way to do this, since (as far as I know) the parser doesn't include the partial as a string, but transforms it to an AST.
This would also not work if you are using dynamic partials, because the included partial is dependent on the data you provide.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello
We're using handlebars for our email templates, one handlebars file per template. Using Mailgun you can't upload partials and reference them and some of our templates share things like footer. So I'm wondering if there's a good way to compile a new handlebars template which bakes in the partials? I'm figuring I can just do a reg-exp replace but I wanted to check if there's an "official" way of doing so.
Cheers
Beta Was this translation helpful? Give feedback.
All reactions