This guide shows you how to create, edit, and test email templates from the TMS administrative interface with no console access required. To use this feature, you’ll first need to have the TMS adminstrative interface enabled for your govDelivery account.
In addition to reading the instructions below, you can watch a short video on this feature.
Creating a New Email Template
- Navigate to the TMS interface by clicking TMS found near the bottom of the left-hand navigation menu in govDelivery.
- Click Templates. If there are already templates associated with your account, you’ll see them under the Email Templates header; otherwise, you will see a message indicating you don’t have any templates yet.
With existing templates:

Without existing templates:

- Click the Add Template button at the bottom of the list.

- Fill out the form with the details of your new template.

- Subject line: What you enter here will be the subject line of the email.
- From address: Enter the email address from which the message will be sent.
- Markup: This field contains the actual HTML markup of the message. In addition to HTML, you can include macros and conditional logic to customize your messages for individual recipients. See the Macros and Conditional Logic sections below for more details.
- Macros: Enter the names and default values for any macros you want to include in the template.
- Template ID: This is the unique identifier for the email template. This field can be left blank, and the system will automatically assign a numeric ID to the template after it is saved. If you provide your own ID, only letters, numbers, - (hyphen), and _ (underscore) characters are allowed. The template ID cannot be changed after a template has been created.
- Click Create to create and save the template.
Editing Existing Email Templates
- Navigate to the TMS interface by clicking TMS found near the bottom of the left-hand navigation menu in govDelivery.
- Click Templates. You’ll see a list of existing templates under the Email Templates header.
- Click on the Edit button next to the template you want to edit.

- Make any necessary changes to the appropriate fields in the template form. These are the same fields you used to create the template. Only the Template ID field cannot be edited.

- Click Save to save your changes, or if you want to send a test message, click the Save & Test button. This opens a dialog that lets you specify what email address the test message should be sent to.

- If the template includes macros, you can specify custom values by using the Edit default macro values checkbox; otherwise, the default values will be used.

- Click the Send button to complete the test send. You will see a confirmation message, and the email will be on its way.

Macros
Macros are key-value pairs. The keys and their default replacement values are defined when creating/editing a template, and per-recipient values are defined at the time the email is sent.
To use a macro in your template, surround it with a set of double square brackets. For example, if a template has a macro called "macroName" you can include it in the template as [[macroName]]. When the email is sent, [[macroName]] will be replaced with either the value provided or, if no specific value was given, the default value.

In the above example, this email will render the text “This is an example template. It includes a macro, the value of which is default.”
As mentioned in the section on Editing Existing Email Templates, it is possible to send a test message with a custom value for any or all of the macros defined for that template. This can be especially useful if you are testing a template that uses any conditional logic.
Conditional Logic
Conditional logic makes it possible to include only certain sections of a template in a specific email if the macro values for that email meet certain conditions.
All conditional logic is wrapped by {% %} tags. The most common usage is to include a block of text if a macro value exactly matches a certain value. This is accomplished using the if / endif (and optionally else) tags.

Note: For a full list of supported operators and additional code examples, see the Conditional Logic section in the TMS API documentation.