Templates hold the text of the messages Portail ZAPP produces: account emails (verification, forgotten password…), notifications, expiry alerts, emails sent from a Service Desk ticket, and some PDF documents. Editing a template changes what recipients receive, without touching the rest of the application.
The Templates screen (menu Administration › Appearance and languages › Templates) is reserved for Administrators.
The template list
Each template has a Key (its identifier, used by the modules that send the message), a Name, an optional Category, the Languages it is written in and a Status (Active or Inactive). The name is shown in your language, here and in every template picker. Search by name (in any language) or key, filter by category. When the Data grids module is installed, the list is a grid.
On each row, the pencil opens the template and the eye opens its Preview.
Most templates ship with the modules. A shipped template that you delete is recreated with its original text the next time the application starts. When an update corrects the text of a shipped template, the correction only applies to the versions you have never edited: your customisations are never overwritten.
Create a template
New template asks for:
- Key: lowercase letters, digits,
_,-and.only, no spaces. It must be unique and cannot be changed afterwards; - Name: one field per instance language; the default language's one is required. A language left empty shows the default language's name;
- Category (free text, to sort the list).
The template is created active and empty: you land directly on its page to add a first language. Creating a template is not enough to use it: the feature that sends the message (for example a notification step in a process, or sending an email from a ticket) is what designates the template.
Edit a template
The Metadata card sets:
- the Name, one per language: everyone sees the template in their own. Shipped templates have their name in French, English and Spanish;
- the Category;
- Active: an inactive template is no longer used. Depending on the feature, the messages that rely on it are sent without its formatting or are not sent; it is no longer offered in template pickers either;
- Wrap in email layout: the content is placed inside the shared email wrapper (logo, colors, footer), see "Style the emails". No effect on notifications shown inside the application.
Click Save to apply.
Language versions
Each language of the template has its own tab, with:
- Subject (required);
- Sender email and Sender name: left empty, the sender configured for the instance is used;
- HTML content: the body of the message.
Add language offers the instance's active languages. Choosing a language that already exists replaces its version.
Delete, in a language's tab, deletes that version only, after confirmation; the template's other languages are kept.
The text can contain variables, written as their name between double curly braces, which the feature sending the message replaces with its values (recipient name, ticket number…). Values are always inserted as text: they cannot inject HTML. Dates are formatted for the language of the message.
When a message is sent, Portail ZAPP picks the version in the recipient's language; failing that, the one in the instance's default language; failing that, the first available version.
Preview
Preview shows the message as it will be sent, wrapper included if the template uses it. Choose the Language, then fill in the Variables (one per line, as name=value): the list is pre-filled with the variables found in the template. Render shows the Subject and the HTML output; Toggle source switches between the rendering and the HTML code. If the template has a syntax error, or if it is inactive, a Render error is shown instead.
Export and import
- Export all downloads all templates and their versions as a JSON file; Export, on a template's page, downloads only that one.
- Import loads a file in the same format. Missing templates are created. For a template that already exists (same key), each version in the file replaces the version of the same language, customised or not; its name and category do not change. An import can turn on a template's email wrapper, never turn it off.
Use export and import to carry templates over from a test instance to production.
Delete a template
Delete template, on its page, deletes it with all its versions, after confirmation. A shipped template comes back at the next start (original text); to stop a message, prefer unticking Active.
See also
- "Style the emails": the shared email wrapper.