Email templates
Learn how to write message templates with dynamic fields, conditions and loops to communicate with your customers or colleagues.
General
Message templates are available in data subject requests, tasks, questionnaire invitations, invitations to complete a processing activity or a data breach, and workflow rules that send a message. Once saved, they are a quick way to communicate with stakeholders. The data of the object concerned can be inserted in the text, with conditions and loops to retrieve more information.
This page explains how to write a template. For template types, sharing, import and export, see the Message templates page.
How to use
To use a template, click Select a template next to the message writing area.

The Select a template panel opens. Search the list for a template, open the Shared templates or Own templates of each type, or choose another workspace that you have access to. Click Select next to the template you want.

If no template fits, click New template. The creation window includes:
the Name of the template, so that you can find it later;
the Template body, the input area;
the option to share the template with all the users of the workspace;
the Preview tab, which displays the rendering of the message in real time;
the Input Data tab, which displays the data of the object concerned by the template.
The Preview and Input Data tabs only appear if you create the template from the place where you write the message, not from the settings.

Customize the template
In the template body, you can apply styles and insert images or tables. The result appears in the Preview tab.
To insert a piece of data from the object, click the braces icon of the toolbar (Insert dynamic fields) and choose a field in the list. The value of the field is inserted at the cursor.

Dynamic fields
Fields surrounded by double braces are variables: they are replaced by the values of the corresponding object (here a data subject request).
Use a field from the Input Data
The Input Data tab lists the properties of the linked object. To display the message of the request, for example:
Find the field in the Input Data tab.
Enter its name in the template body with the syntax
{{message}}.Check the result in the Preview tab.
You can go further with loops, conditions and date formats.
Conditions
A conditional block is only displayed under certain conditions. It starts with an if tag and ends with an endif tag. For example:
The block is only displayed if the request contains an attachment.
Loops
Loops work in the same way, with a variable internal to the loop:
In this example, the loop goes through the purposes list and displays each item in the purpose variable.
Date format
The dates of the Input Data are not presentable as they are. Apply a format to them:
This template gives, for example, 15-03-2023 at 15:40.
A more complete example
The body text below uses all the elements above:
For the request currently being processed, the message is transformed as follows:

Going further
Templates use the Liquid syntax. See the Liquid documentation for the list of tags and filters.
Last updated
Was this helpful?