How-to customize Email Templates

Introduction

This article describes how to customize the CoreOne Suite email templates and translate them into other languages.

Concept

The e-mail templates are stored in XSLT format and are transformed to an HTML file with XML data at runtime. The original templates, which are located in “C:\Program Files\ITSENSE AG\Application Service\Templates”, should not be changed. All available e-mail templates can be overwritten by creating the corresponding files in the following folder:

C:\ProgramData\itsense\Templates

Note

When creating templates, always keep in mind that certain e-mail clients such as Microsoft Outlook can only display a limited subset of the HTML / CSS functionalities. Simple DIVs are already displayed incorrectly there. It is therefore recommended to use a table layout and / or to test the templates well!

Structure of the templates

The templates are all built according to the same pattern. For each notification there is a main file which references all template parts. The file "EMailVerification.EN.tpl" is listed below:

[TemplatePart "../Parts/XslTemplateHeader"] <xsl:template match="/DictionaryOfString_String"> [TemplatePart "../Parts/HtmlHeaderBeforeTitle"]EMail verification[TemplatePart "../Parts/HtmlHeaderAfterTitle"] <tr> <td colspan="5">Please verifiy yourself by entering the following PIN:</td> </tr> <tr> <td colspan="5"> </td> </tr> <tr> <td colspan="5"> <p><b><xsl:value-of select="Items/Item[Key = 'verification_pin']/Value" /></b></p> </td> </tr> [TemplatePart "../Parts/HtmlFooter"] </xsl:template> </xsl:stylesheet>

 

The template in detail:

Line 1

[TemplatePart "../Parts/XslTemplateHeader"]

References the default template header. This contains the customer's logo and the general design in a standard installation.

Line 3

[TemplatePart "../Parts/HtmlHeaderBeforeTitle"]EMail verification[TemplatePart "../Parts/HtmlHeaderAfterTitle"]

References the default template before and after the heading as well as the actual heading in the current language.

Line 12

Output of the Verification PIN

Line 15

References the default template footer.

Multilingualism

The templates can be built up multilingual. To do this, add the extension of the corresponding language to the corresponding template file. If no language is specified, the file is used as default.

File

Language

File

Language

EmailVerification.tpl

Standard Template

EmailVerification.EN.tpl

English

EmailVerification.FR.tpl

French

EmailVerification.IT.tpl

Italian

The language used is always determined via the core identity. If no language is defined there or if a language is defined that has not been translated, the default template is used.

Useful Functions

Formatting dates and times

Get the current date in the format 30.01.2021:

Get the current time in the format 08:15:

How-To articles



© ITSENSE AG. Alle Rechte vorbehalten. ITSENSE und CoreOne sind eingetragene Marken der ITSENSE AG.