Mail templates

Administration PageApplication/ContractSyracuse/CollaborationclassmailTemplatesRepresentationmailTemplate

This entity allows you to define how you can send emails automatically from an entity (the sender entity needs to be defined as notifiable in order to be operational). The email recipients, the subject, and the body of the email can be described, and the data can be retrieved from the sender entity.

Currently, only two entities have this feature set: 'Logfiles management' and 'Flamegraph visualization'.

Information managed

The following information can be associated with an email template:

Name

Identifies the email template

From

Identifies the sender of the email and must be a valid email address

In the following fields, you can enter text and embedded variables in mustache format:

To

List recipients' email addresses separated by commas

Cc

List carbon copy email addresses separated by commas

Bcc

List blind carbon copy email addresses separated by commas

Subject

The email subject in text format

Body

The body of the email in HTML format



These fields do not allow the inclusion of mustache variables:

Mandatory attachments

A list of property names (separated by commas) that stores mandatory files to be attached

Optional attachments

A list of property names (separated by commas) that stores optional files to be attached

Notification theme

Defines the theme used to send the notification

Endpoint

Indicates the endpoint on which the entity associated with the email template has been set

Representation

Indicates the representation of the entity associated with the email template

Entity

Defines the entity managed by the previous representation

Comments about mustache syntax

Here are some interesting syntax examples:

List of a collection

For example: If you have a collection (users) that has two properties (name, firstName).
In HTML, the following syntax for a two-line bullet list is

 <ul><li> element 1 </li><li> element 2 </li></ul>

To include two properties separated by a comma in the list, the HTML code is:
{{#users}}<ul><li> {{name}}, {{firstName}}</li></ul>{{#users}}

This syntax repeats lines for every member of the collection users (the {{#users}}syntax); the syntax in the <li> {{name}}, {{firstName}}</li> executes on the current collection line for the given properties.

Unescaped HTML

The HTML syntax given in the body generates the HTML that is embedded in an email theme if one has been created. It is important to use the syntax {{{template}}} in the theme definition to transfer the body created without escaping the HTML that is generated in the template.