Dynamic HTML Export
Export HTML while preserving Handlebars tags ({{var}}, {{#if}}, {{#each}}) for dynamic delivery pipelines.
Key Takeaways
- Dynamic HTML preserves all {{variables}}, {{#if}} conditionals, and {{#each}} loops intact in the output.
- Ideal for use with ESPs that support Handlebars (like SendGrid Dynamic Templates) or custom server-side renderers.
- MSO comments and table structures wrap cleanly around dynamic conditionals.
- Requires your delivery platform or backend to hydrate values before final dispatch.
How Dynamic Tags are Preserved in HTML#
When you choose Dynamic HTML Export, PostBrix compiles the structural MJML around your Handlebars tags without evaluating them.
For example, a dynamic button in the editor:
Compiles into bulletproof HTML table markup where the tags remain intact:
When this HTML is processed by your delivery platform or backend, the variables are substituted with the recipient's real-time data.
Mapping Dynamic Tags to Non-Handlebars ESPs#
If your email platform uses a different templating syntax (such as Mailchimp's *|FNAME|* or ActiveCampaign's %FIRSTNAME%), remember to map your tags before sending:
- Use find-and-replace in your text editor.
- Or refer to our platform guides in the Email Platforms documentation section.
ESP Merge Tag Translation Engine
Select your delivery platform to see the required syntax for personalized fields.
Frequently Asked Questions
Does the MJML compiler break Handlebars syntax in attributes?
No. PostBrix safely escapes and protects Handlebars delimiters during compilation to guarantee that href="{{url}}" or src="{{img}}" remains valid.
Can I export dynamic conditional blocks like {{#if isVip}}?
Yes. Dynamic conditionals compile into <mj-raw> wrappers that preserve the opening and closing tags around complete HTML table rows.