Admin Guide

Introducing templates


The most powerful way to customize the user-facing content of your helpdesk is to use Deskpro’s Email templates system.

You can edit templates to change:

  • the content of automatic notification emails
  • the portal design and interface text

You can also add custom email templates.

Templates can include phrases: short, re-usable pieces of text, used to store something like the user greeting at the beginning of an email, or the name of a section of the portal.

A major advantage of storing text using phrases is that you can include the same phrase in many templates. Deskpro’s multi-language support is also based around phrases.

You can access Useful template variables from a template, enabling you to retrieve information about the user who is logged in, the ticket they’re currently viewing, etc., and display that back to the user.

You’ll need a basic understanding of HTML to edit templates. If you want to customize the portal design, you’ll need a more advanced knowledge of HTML/CSS.

Here’s an example of how to customize helpdesk content by editing a template and using phrases and variables.

Suppose you decide you want to edit the content of the automatic email users receive when they register an account. By default the email looks something like this:

../_images/new-account-email.png

As you’d expect, “Example User” is automatically replaced with the name of the user who’s receiving the email. We’ll see how this happens later.

Go to Tickets > Email Templates to find the corresponding template. Look under User Email Templates and you will see the Welcome Email template.

../_images/welcome-template.png

Click on the template to open the template editor window.

../_images/template-editor.png

You’ll see that the template contains code for the Email Subject and Email Body.

Let’s look at the Email Body:

{{ phrase('user.emails.greeting') }}

<br /><br />

{{ phrase('user.emails.register-welcome') }}<br/>
<a href="{{ url_full('user') }}">{{ url_full('user') }}</a>

{% if not person.is_agent_confirmed %}
    <br /><br />
    {{ phrase('user.emails.register-agent-validation') }}
{% endif %}

You probably recognize that some of this is HTML markup: <br /> for line breaks and <a href> to make a link.

The other parts, such as {{ phrase('user.emails.greeting') }} and{% if not person.is_agent_confirmed %} ... {% endif %}, are the template syntax.

{{ phrase('X') }} is the syntax to include a phrase in the email.

You can look up phrases by going to Settings > Languages. Under Installed Languages, click on your default language, then Edit Phrases.

../_images/edit-phrases-button-eng.png Under User Interface Phrases, click on Emails to see email phrases. The default content for user.emails.greeting is:

Dear {{to_name}},

When the email is sent, the content of the phrase is inserted into the email. Since the phrase contains the {{to_name}} variable, when the email is sent, the template system replaces this with the variable content, which is the name of the user.

If the email is being sent in another language, the translated version of user.emails.greeting from the corresponding language pack gets inserted instead. For example, here’s the Spanish translation:

../_images/user-e-g-translations.png

Let’s suppose your marketing department has decided that user emails should start with “Hello ...” rather than “Dear ...”

You could replace {{ phrase('user.emails.greeting') }} with Hello {{to_name}}, but that would only change the greeting for this email type, and it wouldn’t be translated into other languages.

A better solution is to go to Setup > Languages and use Edit Phrases to enter and save a custom version of the phrase.

../_images/custom-greeting-phrase.png

All the other email templates which use the phrase will now use the custom version. You can also use Edit Phrases to enter a custom translation for any other languages you have installed.

../_images/spanish-custom-phrase.png

Custom phrases

Sometimes, instead of changing the existing phrases on your helpdesk, you may need to create a new phrase.

To do this, go to Setup > Languages and click on All Custom Phrases then click Add Custom Phrase button.

../_images/custom-phrase-ex.png

You will be prompted to choose a name for the phrase (custom phrase names are always prefixed with custom.).

Note that the Default and Translation sections for a custom phrase are non-functional.

If your helpdesk has multiple languages installed, to translate your custom phrase, you must create it in each language you have, making sure to use the same name for each version. See How do I translate a custom phrase? for details.

Warning

You can’t include variables directly in custom phrases. You must use the method described in Variables in custom phrases.

Comments (0)

Add a comment

Add a comment

You need to log in before you can submit a comment.

Need a password reminder?