Start a conversation

Understanding how custom templates work

We're actively rewriting our user guide, so check back for improved coverage.

Note: We strongly recommend test out any template customizations on a template group which has been added solely for testing purpose (and hasn’t been announced publicly). This ensures that any tweak can tested and final results are visible to you prior to applying the changes to a live template group.

A template group consists of a set of templates dealing with front-end layout, design and outgoing emails. Template sets can be accessed via Admin interface > Options > Templates > Templates


We have compiled a handy list of commonly used template sets, important templates they contain and purpose of those templates for your reference.

Template set
Important templates
Templates dealing with support center layout and those templates which are not app specific.
Support Center header (general layout of elements)
Original CSS file for a template group. Controls the look and feel of template group.
Empty CSS file. Any code entered here overrides original code specified in clientcss. Learn more
emailnotification_html emailnotification_text
Staff notification email. Check available variables here.
Ticket submission and outgoing ticket app specific emails
Department selection page on Support Center
Ticket submission form
Ticket display
Ticket list display
 For e.g. email_autoresponderhtml
Outgoing emails. Name imply their purpose. HTML is only allowed in templates ending with HTML postfix.
Live Support
Live chat badges and chat window specific templates
Chat window header (general layout of elements)
Online chat window
Offline chat window
Proactive chat box
Site badge
Live chat button


Building blocks of templates in helpdesk and editing support available

Template sets in helpdesk are built upon Dwoo Template Engine. HTML and JavaScript code are supported for modification. HTML comments are used for commenting in code. JavaScript is not supported in email specific templates and HTML is not supported in email templates which are meant for text content.

PHP code can be enabled for templates by On Premise clients by uncommenting following constant in ‘config.php’ under ‘__swift\config’ in document root of helpdesk

//define('SWIFT_ENPHP_TEMPLATES', true);

Templates in helpdesk consists of largely the following building blocks:


Contain values for various properties that are based in real-time and can be used as such or with logical conditions per the requirement. These variables are specified and assigned to a template in source code. 

When working in an inactive template group, you can view assigned variables for a template by adding <{dump}> variable to relevant template and then viewing the output on relevant location on Support Center or in email dispatched by helpdesk.

NOTE: The <{dump}> variable contains sensitive information and we strongly suggest that this is NEVER EVER used on a live template group.

Stand-alone variable 


For e.g. <{$_templateGroupPrefix}> 

Variables stored in container (array)


For e.g. <{$_languageItem[isenabled]}>

Language phrase variables

Language phrases available in language packs (identified by ‘identifier’ value) can be referred to in templates via following generic format:


For e.g. <{$_language[arintro]}>

Language phrases can be added to an existing language pack via ‘Insert Phrase’ button from Admin interface > Options > Languages > Phrases 

We recommend inserting a new phrase with a unique identifier to all language packs in your helpdesk to ensure that language selection doesn’t affect language phrase from getting called or doesn’t result in an undefined index error. 

All variables (including language phrase variables) are case-sensitive.

Logical conditions

You can make use of if-else statements making use of variables matching using logical operators to control display of particular sections of code.

Generic format for if-else:

 <{if $variable operator ‘value1’}>

//Code block to be executed

<{elseif $variable operator ‘value2’}>

//Code block to be executed



A live example

‘_activeLanguageID’ variable contains language ID selected for Support Center. This piece of code for example can be placed in ‘header’ template

<{if $_activeLanguageID == '1'}>

You are currently browsing in ‘English (U.S.)’

<{elseif $_activeLanguageID == '2'}>

You are currently browsing in ‘Deutshe (de)’


You are browsing but not in ‘English (U.S.)’ or ‘Deutsch (de)’ language


Blocks and Functions

On Premise clients can check compiled Dwoo specific functions from under ‘__swift\thirdparty\dwoo\plugins\builtin’ in document root. Dwoo provides documentation for blocks and functions

A live example

You can display Reply due counter to a client (making use of date_format function), via adding this piece of code to ‘viewticket’ template under ‘Ticket’ group 

<{$_ticket[duetime]|date_format: "%A, %B %d, %Y %R %Z"}>

Choose files or drag and drop files
Was this article helpful?
  1. Sukhpreet Anand

  2. Posted
  3. Updated