Skip to content
English - United Kingdom
  • There are no suggestions because the search field is empty.

Getting started with the template editor

    The template editor allows you to design your signatures, campaigns and disclaimers for both HTML and Plain text email. You can also preview your templates with user data for any selected user. This article tells you how to get started with the editor, how to use merge fields, and how to use conditional statements.

    Getting started

    The template editor is designed to be easy to use and to allow creating templates without any coding experience:

    The top ribbon allows switching between HTML and Plain Text templates. When in HTML mode you can switch between the Visual Editor, the Source Editor and Preview, and when in Text mode, you can switch between the Source Editor and Preview. Preview allows you to preview the template as it will look in email clients merging with data for a selected user.

    Below the top ribbon there is a menu and a toolbar, providing you access to all the commands of the editor. Editing and using commands will be familiar to users of most email clients and word processing software.

    When creating templates you use merge fields to merge user data such as full name, job title and phone numbers. You can also use conditional statements to control the design depending on if fields are empty or match certain criteria. Finally can use functions and code to manipulate data. For example you can convert data to lower case or upper case. You can find more information on all of this below.

    Merge fields

    The following merge fields are supported in templates:

    Name Merge field
    Company
    Department
    Email
    First name
    Last name
    Full name
    Job title
    Mobile
    Office
    Phone
    Fax
    Street
    City
    State
    Postal code
    Country
    Custom attribute to
    Photo

    You can use merge fields anywhere in HTML and plain text templates.

    Conditional statements

    You can use conditional statements to control the layout of your template depending on user data. This is useful to control the layout, for example, when merge fields are empty.

    Check if field is set

    ...

    ......

    Check if field is not set

    ...

    ......

    Check field against value

    ...

    ......

    The following operators are available for comparing values:

    Operator Description
    <left> == <right> Is left equal to right?
    <left> != <right> Is left not equal to right?
    <left> > <right> Is left greater than right?
    <left> >= <right> Is left greater or equal to right?
    <left> < <right> Is left less than right?
    <left> <= <right> Is left less or equal to right?

    The following operators are available for combining conditional expressions:

    Operator Description
    <left> && <right> Is left true and right true?
    <left> || <right> Is left true or right true?

    String functions

    The table below details some of the supported string functions:

    Function Description
    string.contains Does input string contain specified string?

    Example:

    ...
    string.downcase Convert string to lower case.

    Example:

    string.replace Replaces all occurrences of a string with a substring.

    Example:

    string.slice Returns the substring starting at the specified index and optionally with a specified length.

    Example:

    string.upcase Convert string to upper case.

    Example:

    Avoiding blank or empty lines

    When a conditional statement that evaluates to false includes a whole line this will result in a blank line in the signature. To avoid this, include the line break within the conditional statement. 

    The example below results in an empty field between name and phone in signatures for users that do not have a mobile number:

    To avoid this scenario, the conditional statement should be rewritten to include the line break as the example below:

     

    Coding

    We support the scriban language in templates. Scriban is a fast, powerful, safe and lightweight scripting language. You can use this for example to convert phone numbers to a specific format. The full documentation is available here:

    https://github.com/scriban/scriban/blob/master/doc/language.md