Issue
I want to change the templates of my email, but I don't know how to.
Solution
This article applies to ESET Endpoint Encryption (EEE) Server 2.5.0 or later only
The EEE Server contains a number of template which is uses when generating emails sent to users. These emails could be for different reasons, such as supplying the user a new activation code or informing them of changes to the FDE status on a workstation.
These templates can be easily adapted to suit your own corporate identity, or new custom translations can be added.
Template files and resources are stored in the Templates sub folder under the EEE Server installation folder. For example this could be C:\Program Files\EnterpriseConsole\Templates.
You can edit these directly, however it is recommended you DO NOT do this as any future EEE Server install could overwrite these files and you would be forced to redo your changes. A better solution is to add your own files and modify the custom template reference object. See below.
Including Images
Templates can be both a text component, which is a basic text file, and an html component which may include graphical assets. Assets should be placed in the same folder as the template, and referenced directly in the template. When the EEE Server loads and parses the template, it will attempt to add the linked assets as inline attachments to the message. Please review the existing templates for reference.
It is important that image tags must be complete across a single line e.g. . Altough it is valid in HTML to split the tag so a line break can occur between the "img" and "src" parts, the EEE Server will not parse the tag unless it is a single line tag.
Email template tags
Email templates can make use of serveral tags. You can add these to the EEE Server and they will be replaced with appropriate text when the EEE Server generates the message. The following tags can be used:
Generic Tags
Tag name | Description |
$adminName | The administrators name, as defined in the EEE Server |
$userName | The name of the user, as defined in the EEE Server |
$messageCreationDate | The date the message was created |
$messageCreationTime | The time the message was created |
$messageURL# | A custom URL as defined by the template reference object |
Activation Tags
Tag name | Description |
$activationCode | The activation code text to enter into the activation screen |
$activationURL | The activation code URL for click to activate |
$licenceType | The type of licence |
$licenceDate | The time and date the activation code was generated |
FDE Tags
Tag name | Description |
$workstationName | The name of the workstation |
$workstationID | The workstation ID of the workstation |
$loginType | The type of login. This could be Normal or SSO.*1 |
$fdeLoginUsername | The FDE login username. |
$fdeLoginPassword | The FDE login password. |
$canChangePassword | The boolean text if the user can or cannot change the password.*1 |
$rebootcount | The number of allowed reboots*2 |
$startMode | The chosen start mode (1-4).*1 |
*1 The actual text that will be added is defined in the template reference object. See EmailTemplates.json or EmailTemplatesCustom.json
*2 This tag occurs by default within the text for $startMode. Beause this value is a number that could indicate singular or plural, to avoid ambiguity or using a term such as "reboot(s)", you may use a special tag so the correct singular or plural form can be used automatically. Using the form {$rebootcount|reboot|reboots} means the email will correctly contain the text "1 reboot" or "2 reboots" depending on the actual value of $rebootCount.
Editing the custom template reference object
Once you have your own templates ready to use, you need to edit the reference object so the EEE Server can load and use the new templates. This file can should be located in the EEE Server scripts folder. For example this could be C:\Program Files\EnterpriseConsole\Scripts. The file name should be EmailTemplatesCustom.json.
This object is defined by the JSON language. This allows a complex object to be defined simply in a text file. This can be edited easily by hand using just a simple text editor.
If you wish to edit the object, or create your own custom object, you should contact support. The format can be fairly complex if you are unfamiliar with the JSON notation.
However, broadly speaking the format describes 5 root message types:
- testmessage;
- activation;
- initiatefde;
- modifyfdelogin; and
- addfdelogin.
These relate to the templates for:
- Test Messages from the EEE Server control panel;
- Activation code message;
- Starting FDE on a workstation;
- Modifying a user's FDE login; and
- Adding an FDE login for a user.
Below each of these nodes are sub nodes for different languages. The "en" language is used as a catch-all, which is used as the default if the selected language is not found for example. Thus the "en" version MUST always exisit. Languages can be specified using either a standard ISO 639-1 2 letter code (with optional variant code), in which case the EEE Server will reformat the approiate language name. For example the EEE Server would interpret the code "en" as "English". Alternatively the codes "en-GB" and "en-US" could be used to provide different templates for British English and US English.
The default translations provided with the EEE Server are currently:
- en - English
- de-DE - German
- es-ES - Spanish
- fr-FR - French
- ja-JP - Japanese
- nl-NL - Dutch
- pl-PL - Polish
In addition, activation messages can define seperate templates for different licence groups. Currently these relate to 1 - Windows or 2 - Mobile (iOS) licences.
Within each language node, you can define the html and plaintext template filenames, the subject of the message, and any necessary phrases.
Adding URLs to messages
URLs can be added to the message using the messageURL array with each element in the array relating to the tags $messageURL1, $messageURL2 etc. Each object specified in the messageURL array can specifiy the link text, the actual URL (href), alt text and a target. The href is mandatory, everything else is optional.
For plaintext messages, only the href and text attributes are used. If text is specified, it will be prepended to the href, and the href enclosed in parenthasis.
For example, consider the JSON fragment
"messageURL": [
{
"href": "http://www.eset.com/",
"text": "EEE Website"
},
{
"href": "https://support.eset.com/"
}
]
Then the tag $messageURL1 would expand to "EEE Website (http://www.eset.com/)" whereas $messageURL2 would simply be "https://support.eset.com".
If you wish to specify text that applies only to the HTML template, you use the element texthtml. This can be useful if you want the text tag to include html, or an image, which would not be appropriate for the plain text template.
Adding custom templates
If you choose to implement your own custom templates, you should do these only in EmailTemplatesCustom.json. If you edit EmailTemplates.json this file will be overwritten by an EEE Server upgrade. You should use a lint to ensure your JSON is valid. If your file is not valid, it will simply be ignored by the EEE Server.
A useful JSON lint site is: https://jsonlint.com/
Supported Versions
EEE Server 2.5.0 or later only