Create an e-mail template

Create e-mail templates that can be customised with values from an object.

You need knowledge of SQL to write an e-mail template.

Edit template

Enter the images/download/thumbnails/378766603/Allgemein_i_EN_img.png section and edit the name of the template multilingually in the section "Name" by clicking on the lines in the column "Translation". Select the target object ("Type") for the template in the section "Other". If the opened template is to be used by default, activate the checkbox. Only one default template can be set per object type. If a default template for an object type already exists, it is deactivated in the course of assigning the object type a new default template.

Edit template for a language

Switch to the area images/download/thumbnails/378766608/Templates_img.png and edit the e-mail body and the e-mail subject depending on the language. Select the line of the target language and click on the images/download/thumbnails/378766320/Editieren_Stift_EN_img.png -button.

Select data source

To select a data source, click on the images/download/thumbnails/378767270/image2019-2-4_12-0-14.png -button. Only the data sources that are assigned to the same object type are displayed. If you select a data source, its key appears in the input element and its name is displayed below.

To change the data source, open the search and select the requested data source. To remove a data source, click on the images/download/thumbnails/378767249/L%C3%B6schen_trash_img.png -button.

Create new data source

To create a new data source, open the search and click on the images/download/thumbnails/378767686/Plus-Icon-rund_magenta_img.png -button at the bottom right. The object type is preselected. See the article "Edit Data Source" for a description on how to proceed. It is necessary to select the data source after you have created and saved it.

Edit contents

There is a single text box for the attention line and a larger text editor for the body of the e-mail. In this editor you will find the same text editing elements as in well-known text editing programs like e.g.: Libre Office. The displayed content is automatically interpreted as HTML. If you are familiar with HTML, you can make adjustments by clicking on the images/download/thumbnails/378767444/View-HTML_img.png -button.

Use data of the data source

Once you have selected a data source, you can use parameters to reference the columns of the data source. A parameter can be inserted into the attention line or into the template body by entering the column name within three looped brackets. The parameters are "case insensitive". For reasons of readability, however, it is recommended to use a consistent naming scheme. Use the images/download/thumbnails/378767277/Parameternamen-eingeben_img.png -button to insert parameters. Numeric parameters can be extended with a parameter for formatting. To do so, type ':' after the column name and then insert the desired formatting parameter.

You can find the parameters here.

Example:

{{{value: "N"}}}

Additional parameters

Parameter

Description

url

This parameter allows you to create a URL that points to the entity (object) that was used to open the e-mail creation window.

A reference URL is not generated for e-mails that are created without an entity (general e-mails).

username

Login name of the user who fills in the e-mail template.

fullname

Name of the sender. It usually corresponds to the name of the user. It may differ if a default sender, such as "noreply", is stored in the database (e.g. in case of automatically generated e-mails of Print Jobs).

useremail

Sender address. It usually corresponds to the user's e-mail address, but it may differ if the user did not submit an e-mail address or if a default address such as "noreply@example.com" is set (e.g. in case of automatically generated e-mails of Print Jobs).

languagecode

Target language used for loading the template (e.g. en).

language

The Innosoft Language Id corresponding to "languagecode" (mapped via IS_Language).

There is a bug in the Kendo component that sometimes inserts additional HTML within the three looped brackets. Accordingly, the parameters cannot be committed or exchanged correctly. If this bug affects your system, click on the '</>'-button in the toolbar and remove the faulty DOM-elements from the parameters.

Insert images

Use the images/download/thumbnails/378767129/Bild-hinzuf%C3%BCgen_grau-hinterlegt_img.png -button to insert images.

Insert images via a storage medium

In order to insert a picture via a storage medium, select the image in the file selection dialogue.

Insert images via data source

If the data source returns an image in Base64, you can directly insert it. Select "data source" in the image insert dialogue, then enter the column name.

Test a template

Use the action images/download/thumbnails/378766617/Execute_Text-schwarz_img.png to generate a preview. This action becomes visible as soon as the attention line or the content of the e-mail is entered. If you use a data source that uses additional parameters, a dialogue field to enter the required parameters opens.

Copy

Use the action images/download/thumbnails/378766239/Kopieren_EN_img.png to transfer entries from another language.

Define e-mail body via data source

For using this functionality, you need knowledge about SQL and HTML. Therefore, the use of this function is only suitable for experienced users.

The text editor itself only interprets HTML and it is therefore possible to define entire HTML-DOMs and properties of the e-mail body, such as colour, background colour, font etc. via the data source. This requires the data source to return the DOM or corresponding value. If, for example, the data source only returns style properties of an HTML element, you can retrieve the HTML via the images/download/thumbnails/378767444/View-HTML_img.png -button and then refer to the column as a parameter.

There is a bug in the utilised Kendo component which does not allow the customised HTML to be saved in certain constellations. If this bug affects your system, you have to insert the HTML manually into the corresponding data bank using a query.

Examples

These examples are intended only to demonstrate the technical procedure.

Define properties via a data source

In this example, the data source returns a colour that is to define the background colour of a DIVs element. One possible HTML script looks like this:

<div style="height:100px;width:100px;background-color:{{{color}}};">
{{{color}}}
</div>

Define HTML-DOM via a data source

This example shows an SQL defining the HTML-DOM in use:

with tmp as (
select 0 as code
)
select
(case
when code = 0 then 'red'
when code = 1 then 'yellow'
when code = 2 then 'green'
else 'white'
end) as Color,
(case
when code = 0 then '<div style="height:33px;width:100px;background-color:red;"></div>'
when code = 1 then '<div style="height:67px;width:67px;background-color:yellow;"></div>'
when code = 2 then '<div style="height:100px;width:33px;background-color:green;"></div>'
else '<div style="height:0;width:0;"></div>'
end) as Body
from tmp

The e-mail body subsequently looks like this:

{{{body } } }