Menu icon Foundation
Panini / Handlebars Marketo token conflict

I've just started using Foundation for Emails to build email templates. The build process that bundles is working well enough for me in terms of writing markup and styling via Sass. I previously used Ink (v1) and had a Grunt-based build process which was a lot like v2 so I'm comfortable using the command line and creating Grunt / Gulp build tasks. I don't however have experience using Handlebars (I previously used grunt-includes to handle includes).

The issue that I'm facing is when building email templates for Marketo. For all of its tokens (firstname, unsubscribe, custom tokens) it uses the same double-curly-brackets syntax as handlebars / panini. As an example, first name is {{lead.First Name:default=Sir/Madam}}, unsubscribe is {{system.unsubscribeLink}} and custom tokens are {{my.UTM tags}}.

When I try to include any of these they throw up the following console errors.

Does anyone know of a way of excluding certain tokens from the Panini / Handlebars build process?

I build a lot of emails for Marketo so this is looking like a deal breaker for me. I really like the out-of-the-box build process and would prefer not to have to replicate that manually.

marketopaniniHandlebars

I've just started using Foundation for Emails to build email templates. The build process that bundles is working well enough for me in terms of writing markup and styling via Sass. I previously used Ink (v1) and had a Grunt-based build process which was a lot like v2 so I'm comfortable using the command line and creating Grunt / Gulp build tasks. I don't however have experience using Handlebars (I previously used grunt-includes to handle includes).

The issue that I'm facing is when building email templates for Marketo. For all of its tokens (firstname, unsubscribe, custom tokens) it uses the same double-curly-brackets syntax as handlebars / panini. As an example, first name is {{lead.First Name:default=Sir/Madam}}, unsubscribe is {{system.unsubscribeLink}} and custom tokens are {{my.UTM tags}}.

When I try to include any of these they throw up the following console errors.

Does anyone know of a way of excluding certain tokens from the Panini / Handlebars build process?

I build a lot of emails for Marketo so this is looking like a deal breaker for me. I really like the out-of-the-box build process and would prefer not to have to replicate that manually.

Glenn McComb about 3 years ago

Just to further clarify: The unsubscribe and firstname tokens aren't breaking the build process but they are being stripped out of the resulting markup.

Glenn McComb about 3 years ago

Ok, so I hate to be that guy but I actually just figured out how to handle this. I'm able to get the tokens coming through by replacing the curly braces with their respective HTML entities:

{{lead.First Name:default=Sir/Madam}}

Boom!

Hopefully if anyone else ever comes across this problem this thread serves as a handy reference. I'm not upset if this thread needs to be deleted.