DESlock+ Support DESlock+ Support
Knowledgebase
How can I modify email templates used by the Enterprise Server?
Article ID: KB144 email a link to this article

This article applies to Enterprise Server 2.5.0 or later only

The Enterprise 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 Enterprise 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 Enterprise 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 Enteprise 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. <img src="image.png">. Altough it is valid in HTML to split the tag so a line break can occur between the "img" and "src" parts, the Enterprise 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 Enterprise Server and they will be replaced with appropriate text when the Enterprise Server generates the message. The following tags can be used:

Generic Tags

Tag name Description
$adminName The administrators name, as defined in the Enterprise Server
$userName The name of the user, as defined in the Enterprise 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 Enterprise Server can load and use the new templates. This file can should be located in the Enterprise 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:

  1. testmessage;
  2. activation;
  3. initiatefde;
  4. modifyfdelogin; and
  5. addfdelogin.

These relate to the templates for:

  1. Test Messages from the Enterprise Server control panel;
  2. Activation code message;
  3. Starting FDE on a workstation;
  4. Modifying a user's FDE login; and
  5. 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 Enterprise Server will reformat the approiate language name. For example the Enterprise 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 Enterprise 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.deslock.com/",
"text": "DESlock+ Website"
},
{
"href": "http://support.deslock.com/"
}
]

Then the tag $messageURL1 would expand to "DESlock+ Website (http://www.deslock.com/)" whereas $messageURL2 would simply be "http://support.deslock.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 Enterprise 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 Enterprise Server. 

A useful JSON lint site is: http://jsonlint.com/

 

Supported Versions

Enterprise Server 2.5.0 or later only

 

Keywords: Customise, Customize, Email, Change,


We use cookies on our website to enhance your browsing experience. Read more