Using the Template Code Editor

The Dyspatch code editor is where you can write and test template code, view a preview of your email, and set metadata, all in one place.

This article is for the legacy code editor only.

In the Code Editor

In this example, we’re working on the first draftDraftAn in-progress version of a template. A template can have multiple drafts, which you can create and edit without affecting production emails. of a template named "Our Welcome Email". We haven’t yet added a Subject or a Preheader for our template, but we've written a bit of code in the editor and a preview of that code is visible in the email preview on the right.

Subject Line

The subject is where you enter the subject line of an email. Using JinjaJinjaDyspatch uses Jinja, a powerful templating language that you can leverage to create personalized email content. in the subject is acceptable.


The preheader, also sometimes called preview text, is the text that follows the subject line in an email inbox. Jinja can be used here as well. Read more about the Preheader here.

The Body Tab

code editor body tab

The Body tab is where you enter the HTML, CSS, and Jinja code that make up an email template. Adding and editing code will automatically update the email preview. Use the Undo and Redo buttons to make corrections. You can toggle between editing HTML and Text by using the switch at the top-right of the editor pane.

The Sample Data Tab

code editor sample data tab

Add sample data in JSONJsonJSON is a format for representing data with key and value pairs, used to store and exchange data. format on the Sample Data tab to test the look of your email with dynamic content and personalization variables populated. Read more about how Sample Data works in our article about Sample Data here.

The Localizations Tab

code editor sample data tab

The Localizations tab is where you create and manage different localized versions of your template. To learn more about localizationLocalizationThe process of creating locale-specific content for a template., read our localizing a template article.

The Metadata Tab

code editor metadata tab

The Metadata tab is where you enter your ‘From’ and ‘Reply’ details for your email, such as ‘Sender’ and ‘Reply To’ names and email addresses. You can also see the template's ID on this tab. Our setting up metadata

Saving, Testing, and Submitting a Draft

code editor complete draft

To create a new draft or to view a list of existing drafts, click the draft name, in this case "First draft". You can also save your draft at the top. Click the Preview button to test your email on a variety of devices and email clients with device testing, send a test email, or to submit your draft for approval.

Didn't find what you're looking for?

Ask our support team, we're here to help!

Contact Support