Customizing a queue's email templates

To access a queue's Email Templates settings go to Admin > Queues > Edit Queue () icon for the queue > Email Templates tab.


How to customize email templates

Each outgoing email you send, whether its a ticket reply or internal note, is built by one or more email templates. These templates allow you to customize the content and layout of your queue's emails using a combination of text, HTML code, and tokens.

Outgoing emails are sent in HTML format, so make sure that you enclose all of your text and tokens inside of HTML tags. Otherwise, the text of your templates will have no formatting.

  • Line breaks are not preserved, so be sure to use <p>, <div>, <br>, or similar elements for your text.
  • If you want to style your text, make use of elements like <strong> or <em>.
  • You can also use inline styles, too. For example: <span style="color: red;">This text is red!</span> 

Working with tokens

A token is a piece of shortcode that represents certain information from the ticket. For example, when you use the {{t.question}} token in a template, it represents the text of the question. Wherever you place that token in the template is where the question text will appear. Each template has its own set of available tokens; although some templates share the same tokens, not every token will work in every template. Click on the Template Instructions button for a complete list.

Screenshot highlighting the Template Instructions button

Token syntax

To show content only if a token contains data, put it inside of template tags. For example, if you only want to show the {{{details}}} token if the ticket has text in the More Details field, you would use:

{{#details}}
    This will show if the details field is not empty. The details field will be shown on the next line.
    {{{details}}}
{{/details}}

To show content only if a token does not contain data, you would use a different set of template tags:

{{^details}}
    This will show if the details field is empty.
{{/details}}

Some tokens represent a list of similar items. For instance, the r.files token represents 0 or more files attached to a reply. With the example below, you can show a heading for the files if there is 1 or more, and then iterate over the files, formatting how they display. Within the r.files token the files are represented by the file tags.

{{#r.files}}
    <p style="font-weight: bold; color: #666;">Attached Files</p>
    <ul>
        {{#file}}
            <li><a href=\"{{url}}\">{{title}}</a></li>
        {{/file}}
    </ul>
{{/r.files}}

Available templates

Each queue has the following templates:

Reply to a Ticket (to patrons)

This is the template used when a reply is sent to the patron. The {{{qoutput}}} can include the following partial templates:

  • Question in Thread (displays the original question)
  • Reply in Thread (displays the text of each reply)

Internal Note on a Ticket

This is the template used when an internal note is sent to another LibAnswers user or an email address in your LibAnswers address book. The {{{qoutput}}} can include the following partial templates:

  • Question in Thread (displays the original question)
  • Reply in Thread (displays the text of each reply)
  • Internal Notes (displays the text of internal notes)

Assign Ticket to User

This is the template used when you assign a ticket to another LibAnswers user. The {{{qoutput}}} can include the following partial templates:

  • Question in Thread (displays the original question)
  • Reply in Thread (displays the text of each reply)
  • Internal Notes (displays the text of internal notes)

Transfers to Address Book Entries

This is the template used when you assign a ticket to an address book entry. The {{{qoutput}}} can include the following partial templates:

  • Question in Thread (displays the original question)
  • Reply in Thread (displays the text of each reply)
  • Internal Notes (displays the text of internal notes)

Submission Confirmation (to patrons)

This is the template used when a patron opts to receive an email confirmation after submitting the question form. The {{{qoutput}}} can include the following partial templates:

  • Question in Thread (displays the original question)

Partial Templates

  • Question in Thread: this is used wherever the text of the original question is displayed in a full template.
  • Partial Template: Internal Notes: this is used wherever the text of an internal note is displayed in a full template.
  • Partial Template: Reply in Thread: this is used wherever the text of a reply is displayed in a full template.

Related Articles