Welcome, Guest Login

Support Centre

How Do I Customise Email Templates?

Last Updated: Feb 28, 2013 05:22PM GMT
mkryptor version(s): 2.0

This article describes how to customise the default email cover templates that ship with mkryptor. This is useful if you want to add your own company branding to the cover messages
 
Note: If you just want to find how to add personal text to the cover templates, see this linked article.

Contents

Indroduction

Templates are used to define the style and content of the various cover emails and generated PDF documents. To make life easier, a default set of templates are provided in the ‘SampleTemplates’ sub-directory of the mkryptor installation folder (e.g., c:\program files\freshskies\mkryptor\SampleTemplates). When customising templates it is always recommended to use these default templates as a base.
 
Note: The SampleTemplates directory will be overwritten every time mkryptor is updated. Do not edit the templates directly in this folder, instead take a copy of the SampleTemplates folder first and edit the templates in the copy. Give the new folder a sensible name, such as CustomTemplates

Example template


For every template (with the exception of ‘HeaderTemplate’), there is both an HTML (.htm) and a Plain Text (.txt) version of the templates. These are used for the HTML and Plain Text email bodies respectively.
To tell mkryptor where to insert dynamic information (such as sender address, known fact names, etc), special place-holder tags are used in the template file.
 

Using custom templates

To override the default templates with custom versions you need to set the path to the template directory in the mkryptor Configuration Manager.

Mkryptor will look in this folder for the custom templates. The templates must have names that match those listed in the template names list (below).

With the exception of ‘HeaderTemplate.htm’, you should provide both an .htm (HTML) and .txt (Plain Text) version for each template.

If a file is found that matches one of the pre-defined names then it will be used in place of the default template. If a file doesn’t exist for a given template, then the default will be used. This means that you only need to provide custom versions for the templates that you actually want to override, you don’t have to provide custom versions of all templates.
It is possible to set templates for the whole server, or on a per-domain / address basis.

Set custom templates for whole server

On the general tab of the mkryptor configuration manager, tick the checkbox next to 'Template Path' and then click browse to browse to the directory containing your custom templates.

Set custom templates per domain / email address

If your mkryptor installation serves multiple domains or departments, you may want to have different templates for each domain / departments, or even for an individual email address.

To accomplish this keep each set of templates in its own folder, then set the path to the template folder on the Mail Out tab of the mkryptor configuration manager.

Each Mail account has a "Sender Domain" and a "Template Path setting". Templates in the specified Template Path will be applied to mails sent from addresses matching the Sender Domain.
A sender domain can either be *@domain.com or a full email address. To add additional Mail Accounts click the + symbol at the bottom of the screen.


 

Tips for customising templates

Templates can be edited using any text editor (e.g., Notepad) or an html editor.
Here are some general rules to adhere to when editing HTML templates:
  • You will make your life much easier if you start with the default templates and then add your customisations to them.
    • The default templates are designed to work well across nearly all email clients, and include enhancements for iPhone and other mobile clients
  • Avoid the use of <DIV> elements for layout. Many email readers will not display them correctly.
    • Use <TABLE> elements for layout instead
  • Do not use CSS Style Sheets (either embedded or external), as most email readers will ignore them
    • Use inline styles instead
  • Avoid ‘fancy’ formatting and styles. Most email readers only support a subset of the CSS styles available. Keeping your styling simple will help the look stay consistent across multiple email readers.
 
We recommend email on acid which has some great resources and tips for designing and testing emails

Template reference


The table below details which templates are available for customising, which situations they are used in and what place-holder tags need to be included.

Note that 2 files should exist for each template. The HTML version should have an extension of .htm (e.g., AdminTemplate.htm) and the plain text version should have an extension of .txt (e.g., AdminTemplate.txt). The exception to this rule is HeaderTemplate, which only requires a .htm version.
 
Template Name Description
AdminTemplate Used for administrative notification emails. Examples are:

·         Confirmation notices when saving known facts
·         Confirmation of password updates

These messages may get sent out to both senders and recipients.
 
Tags:
Tag Description
##Message The message content
##Title A title for the message. E.g., “Notification”
ConfirmTemplate Reserved for future use. No This template can be ignored.
ErrorTemplate Used for reporting errors to sender / administrator. Tips are usually given in the message to help the user rectify the error.
 
Tags:
Tag Description
##Errors A list of error descriptions
##Help A list of tips on how to rectify the error(s)
##Message The message
##Title A title for the error message. E.g., “Non-Delivery Report (NDR)”
HeaderTemplate This is the header content inside the PDF. It shows information such as TO:, FROM:, Attachments:, etc. It is designed to replicate a normal email client.
 
Example:


NOTE: This template is quite complex. It is recommended to keep edits for this template to a minimum (e.g., Adding images or changing styles). Removing anything may cause the system to malfunction.
 
Tags:
Tag Description
##Attachments A list of file attachments from the email
##mKryptorCcAddress The email Carbon Copy (CC) recipients
##mKryptorCcUrl This should be used as an href in an <a> tag surrounding the ##mKryptorCcAddress. It will create a mailto:link
##mKryptorFromAddress The email sender
##mKryptorFromUrl This should be used as an href in an <a> tag surrounding the ##mKryptorFromAddress. It will create a mailto: link
##mKryptorToAddress The email recipients
##mKryptorToUrl This should be used as an href in an <a> tag surrounding the ##mKryptorToAddress. It will create a mailto: link
##Subject The email subject
##Sent Time/Date stamp when message was sent
 

In addition to the tags, HTML elements with the following IDs must be included:

 
Id Description
mKryptorActionSection A <TR> that will contain the action buttons (such as Secure Reply, Change Password, etc).
Will be hidden if there are no actions to apply to message (e.g., reply features disabled)
mKryptorAttachmentSection A <TR> containing the ##Attachments tag. Will be hidden if the message has no attachments
mKryptorCcSection A <TR> containing the ##CC tag. Will be hidden if message has no CC recipients.
mKryptorPasswordButton An <Input> button for the Change Password feature. Will be hidden if the change password feature is disabled
mKryptorReplyButton An <Input> button for the Secure Reply function. Will be hidden if reply feature is disabled
mKryptorSignature This section should contain 1 image. It is used to apply a PDF digital signature to the document (if the PDF signatures setting has been enabled)
   
HelpTemplate This message is returned if a user sends a message to the ‘help’ mailbox (e.g., help@mkryptor). It is supposed to give a brief user guide on how to use the system.
 
Tags:
Tag Description
##prefixEmail The “EmailPrefix” tag set in configuration settings
##SecureMailbox Returns the email address of the “SMTPSecurePdfMailboxes”, determined from configuration settings
##tagPrefix The “TagPrefix” set in configuration settings
##UnsecureMailbox Returns the email address of the “SMTPUnsecureMailboxes”, determined from configuration settings
##ZipMailbox Returns the email address of the “SMTPSecureZipMailboxes”, determined from configuration settings

 
Note: In mkryptor version 1.1 help is only given for the Standalone Mode configuration. Help for Pass-through Mode configuration will be added in a future release.
PasswordTemplate Seen by recipients when the message has been encrypted using a standard password, rather than known facts. It is very similar to the SecureTemplate but the wording has been changed slightly to reflect that the password is case sensitive, and that the password should have already been provided to them.
 
Tags:
Tag Description
##FootNote Any special comments for the recipients attention. For example, when a potentially bad attachment has been removed from the PDF.
##ForgotPassword An extra <LI> item that will be inserted when the ‘forgotten password’ feature is available. It provides a link to the password reminder service
##mKryptorPreamble​ User specified text in the cover note. Often used to describe what is in the secure message. E.g., Hi Joe, this is the top-secret thing I was talking about.

See the article "Adding a cover note" for more information.
##Sender The sender (From:) of the email
 

In addition to the above tags, you should also include HTML elements with the following IDs

 
ID Description
DownloadPdf Used to show/hide a link to a PDF reader. Only shows if message has been encrypted as a PDF
DownloadZip Used to show/hide a link to a Zip reader. Only shows if message has been encrypted as a Zip
ReminderTemplate This template is used for sending password reminders.

Tags:
Tag Description
##mKryptorSender​ Tells the recipient which password they are being reminded of. E.g., "For emails from joe@bloggs.com your password is:"
##mKryptorPassword The password reminder
SecureTemplate The standard template seen by recipients when the message has been encrypted using Known Facts.
 
Tags:
Tag Description
##DateFormat Shows which format dates should be entered in. Determined from the “DateFormat” configuration settings.
##FootNote Any special comments for the recipients attention. For example, when a potentially bad attachment has been removed from the PDF.
##mKryptorPreamble User specified text in the cover note. Often used to describe what is in the secure message. E.g., Hi Joe, this is the top-secret thing I was talking about.

See the article "Adding a cover note" for more information.
##Password A list of Known Facts used to encrypt the message. Should be surrounded by a <UL> element in the HTML template.
##Sender The sender (From:) of the email
 

In addition to the above tags, you should also include HTML elements with the following IDs

 
ID Description
DownloadPdf Used to show/hide a link to a PDF reader. Only shows if message has been encrypted as a PDF
DownloadZip Used to show/hide a link to a Zip reader. Only shows if message has been encrypted as a Zip
UnsecureTemplate This template is used when a message has been converted to a PDF, but not encrypted. I.e., when a message has been sent to the “SMTPUnsecureMailbox”, contains a ##Encrypt:Unsecure tag or has a SendMethod=Ignore setting in the database.
 
Tags:
Tag Description
##FootNote Any special comments for the recipients attention. For example, when a potentially bad attachment has been removed from the PDF.
##mKryptorPreamble User specified text in the cover note. Often used to describe what is in the secure message. E.g., Hi Joe, this is the top-secret thing I was talking about.

See the article "Adding a cover note" for more information.
##Sender The sender (From:) of the email

 
In addition to the above tags, you should also include HTML elements with the following IDs

 
ID Description
DownloadPdf Used to show/hide a link to download a PDF reader. Only shows if message has been encrypted as a PDF
DownloadZip Used to show/hide a link to download a Zip reader. Only shows if message has been encrypted as a Zip
http://assets3.desk.com/
false
@mkryptor
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete