Creating Custom Email Template

Jason He Updated by Jason He

DeskDirector has several events that send out email notification, that include approvals, mail login tokens and ticket life cycle notifications. You can customize them to fit your own style or branding and in this article, we will go through how to create and use customized templates.

Creating a new Email Template

To get started, login to your admin console and head toEmail > Custom Template. Go to the template event you want to create a template for (e.g. Reset Password) then click on "New Template" button then specify a template name.

Make sure you are in the right template category before creating a new template because you can't use an email template on an event it is not built for. For example, templates built under "Reset Password" can't be used in the "Mail Auth Token" event.
Customizing the Email Template

The template engine used on template editor is combination of MJML and Liquid. You can check our article on template editor here to give you an overview in customizing the email template. This gives a lot of flexibility on how you want the email template to look and function.

The easiest way to create a template is to import a sample template then customize it to fit your need. After the new template has been created, click on the ellipses in the upper-right corner of the editor then click Import Sample Template from the dropdown. Select a sample from the list and click Import.

You can utilize the split view feature to preview and edit the template the template at same time.

Modify the imported content in the editor to your liking, then click Save. Your new custom template is now ready to be used for the corresponding Notification Event you want to use it for.

Customization Guide

Display content according to your office hours

The token Context.IsOfficeHour can be used to control what content should be included in your emails according to your office hours settings.

For example, to display content when current time is office hour

<mj-raw>{% if Context.IsOfficeHour %}</mj-raw>  
Now is our office hour.
<mj-raw>{% endif %}</mj-raw>

and to display content when current time is NOT office hour

<mj-raw>{% unless Context.IsOfficeHour %}</mj-raw>  
Now is outside of our office hours.
<mj-raw>{% endunless %}</mj-raw>

How did we do?

Getting Started with Email Template Engine - DeskDirector

Setting Email Templates for Notification Events