Skip to main content

Template development

This section is for template authors: designers, email developers, and anyone building the system that marketers use in the Email Editor.

In Better Email, a strong template does more than look good. It gives marketers the right amount of flexibility, keeps the brand consistent, and makes common workflows fast.

What you will find here

TODO: Add a screenshot of the Template Editor with the module picker, code editor, and right-side tabs highlighted.

If you are new to Better Email template building, this order works well:

  1. Creating your first template
  2. Template Editor
  3. Modules
  4. Settings
  5. Validations
  6. Building a design system

Preview-aware rendering with context.isPreview

Templates can access context.isPreview during render. This is useful when you want the preview experience to behave differently from the final exported output.

A common example is ESP-specific code that is required in export, but makes the in-product preview hard to read or visually noisy.

For example, you might want:

  • clean placeholder or fallback content in preview
  • raw ESP code such as AMPscript in the final exported email

That pattern can be handled directly in Liquid:

{% if context.isPreview %}
<p>Preview text for the editor</p>
{% else %}
%%[
/* AMPscript or other ESP-specific export code */
]%%
{% endif %}

Use this when the export logic is technically necessary, but not useful to show in preview.

As a rule of thumb:

  • use context.isPreview to improve clarity in preview
  • keep the preview branch visually representative of the final email where possible
  • use the export branch for ESP-specific logic that should only appear in the delivered output

Older templates use meta.isPreview, which still works — new templates should use context.isPreview. See the render context for everything else available under context.

The goal

The best Better Email templates are easy to maintain and easy to use. If a marketer can build a polished campaign without touching HTML, the template is doing its job.