Email templates decide what the emails from your platform look like. The outgoing template frames every email reply to customers, and the notification templates hold the texts of the emails agents receive. You edit both under Admin > Notifications > Templates, and both accept expressions such as {{ .Recipient.FirstName }} that the platform replaces with real values at sending time.
Where templates live
Admin > Notifications > Templates has two tabs: Outgoing email templates and Email notification templates. Editing them needs the Manage templates permission. New template works on the outgoing tab only; the notification templates are built in, so you can change them but not delete them.
The outgoing template
The outgoing template frames:
- replies to customers in email inboxes, whoever writes them: an agent, the AI assistant or a rule;
- the emails agents receive about their work (see below).
Replies in the chat widget, Telegram and WhatsApp are not framed. Invitations to new agents and password reset emails also have a fixed layout of their own, written in the platform language.
You can keep several outgoing templates, but only the one marked Is default is used, and only one can have that mark. To move the mark, clear Is default on the current template first; otherwise saving is refused with a message saying another template is already the default. An outgoing template has no subject field.
The template must contain {{ template "content" . }}: that is where the message goes. The panel refuses to save an outgoing template without it, or with a syntax error, and says so. Normally it stands once; if it stands twice, the reply appears twice. A default template saved before this check that has no {{ template "content" . }} stops email replies: they are marked as not sent until you fix the template.
What a new platform uses
A new platform has no outgoing template. Email replies go out exactly as the agent wrote them, and the emails to agents get a simple frame: your site name on top and a line at the bottom saying the email comes automatically from your support panel.
When you add a default outgoing template, it frames both kinds of email. Write it so that it reads well for customers and for your own agents, for example with a greeting to {{ .Recipient.FirstName }}, which is the right person in both cases. Avoid the Contact variables there: SLA emails to agents have no contact, and the email would show <no value> in their place.
Variables
| Variable | Value |
|---|---|
{{ .Conversation.ReferenceNumber }} |
Reference number of the conversation |
{{ .Conversation.Subject }} |
Subject of the conversation |
{{ .Conversation.Priority }} |
Priority of the conversation |
{{ .Conversation.UUID }} |
Internal identifier of the conversation, used in links |
{{ .Contact.FirstName }}, {{ .Contact.LastName }}, {{ .Contact.FullName }}, {{ .Contact.Email }} |
The customer |
{{ .Recipient.FirstName }}, {{ .Recipient.LastName }}, {{ .Recipient.FullName }}, {{ .Recipient.Email }} |
The person who receives this email |
{{ .Author.FirstName }}, {{ .Author.LastName }}, {{ .Author.FullName }}, {{ .Author.Email }} |
The person who wrote the message |
{{ .IsAIComposed }} |
true when the AI assistant wrote the reply |
{{ .IsContinuityEmail }} |
true when the email carries chat messages to a visitor who left the chat |
In a reply to a customer, Recipient and Contact are the same person. In the emails to agents, Recipient is the agent. When the platform sends something by itself, for example a rule's reply, the Author fields are empty, so such an email carries no author name.
Functions
| Function | Value |
|---|---|
{{ RootURL }} |
The address of your support panel |
{{ SiteName }} |
Site name from Admin > Workspace > General |
{{ LogoURL }} |
Address of your uploaded logo |
{{ FaviconURL }} |
Address of your uploaded favicon |
{{ Date "2006-01-02" }} |
The current date and time in a Go time layout; {{ Date "" }} gives a format like Mon Jan 2 15:04:05 2006 |
{{ L.T "key" }}, {{ L.Ts "key" "name" value }} |
A text from the platform dictionary, in the platform language |
The seven built-in templates for agents use L.T and L.Ts for their wording. Keep those parts if the emails should follow the platform language.
Expressions in replies, notes and macros
The same expressions work in what your team writes: agents' replies and private notes, macro responses, and replies and notes sent by rules. They are replaced when the message is saved, so the agent already sees the final text in the conversation. This works in every channel, not only email.
Text from customers and the AI assistant's replies are never run as templates. If a customer writes {{ .Contact.Email }} and the assistant repeats it, the customer sees those characters as typed, not an address. In what your team writes, a loop over a number ({{ range 100 }}) or over more than 10,000 items, and a result longer than 1 MB, are not filled in: the message keeps the text exactly as typed.
Earlier messages under the reply
{{ .PreviousMessages }} is the list of earlier messages of the conversation, so the outgoing template can quote the history under each reply. It holds up to 10 messages, newest first, and only those the customer has seen: the customer's own emails, without the history they quoted, and your replies that went to the customer's address. Private notes, failed messages, surveys and emails to a visitor who left the chat are left out, and continuity emails get no list. Each item has .SenderName, .SenderEmail (the customer's address on their messages, empty on yours, so your agents' login addresses never reach the customer), .CreatedAt, .IsIncoming (true for the customer's messages) and .Content (plain text with line breaks). For example:
{{ template "content" . }}
{{ range .PreviousMessages }}
<p style="color: #71717a;">{{ .SenderName }}, {{ .CreatedAt.Format "2 Jan 2006 15:04" }}:<br />{{ .Content }}</p>
{{ end }}
The list is built only when the default outgoing template mentions PreviousMessages. Our layout from Reset to default does not include it.
Writing HTML
Templates are HTML. Wrap paragraphs in <p> and break lines with <br />: text without tags arrives as one long line. Emails to agents also get a plain text version added automatically.
Example of an outgoing template
<p>Hello {{ .Recipient.FirstName }},</p>
{{ template "content" . }}
<p>Kind regards,<br />
{{ if .Author.FullName }}{{ .Author.FullName }}, {{ end }}{{ SiteName }}</p>
<p style="color: #71717a;">Ticket #{{ .Conversation.ReferenceNumber }}</p>
{{ if .IsAIComposed }}<p>This answer was written by our AI assistant.</p>{{ end }}
How the template wraps a message
What the agent types replaces {{ template "content" . }}; everything around it comes from the template. With the example above, an agent writes only the body:
Your order left our warehouse today and should reach you within two days.
and the customer receives:
Hello Anna,
Your order left our warehouse today and should reach you within two days.
Kind regards,
Mark Lee, Acme Support
Ticket #1042
If the agent also types «Hi Anna» and «Best, Mark», the customer gets two greetings and two signatures. Agents should know which parts the template already adds.
Other template shapes
If the template has no greeting, agents greet the customer themselves. If it is nothing but {{ template "content" . }}, agents write the whole email, greeting and signature included. Check the default template before you tell your team how to write.
AI disclosure and continuity emails
Use {{ .IsAIComposed }} to mark answers written by the AI assistant, and {{ .IsContinuityEmail }} to leave out parts that make no sense when unread chat messages are emailed to a visitor who left the chat:
{{ if .IsContinuityEmail }}
<p>Here are the replies you missed in the chat:</p>
{{ else }}
<p>Hello {{ .Recipient.FirstName }},</p>
{{ end }}
Notification templates
The Email notification templates tab holds the texts of these emails. Each has a body and, except CSAT request, a subject; both accept expressions.
| Template | Sent to | Extra variables |
|---|---|---|
| Conversation assigned | The agent who got the conversation | none |
| Mentioned in conversation | The mentioned agent | {{ .MentionedBy.FirstName }}, {{ .MentionedBy.LastName }}, {{ .MentionedBy.FullName }}, {{ .MentionedBy.Email }}, {{ .Message.Content }} (text of the note), {{ .Message.UUID }} |
| New reply from contact | The assigned agent | {{ .Message.Content }}, {{ .Message.UUID }} |
| New reply on participating conversation | Other agents who wrote in the conversation | {{ .Message.Content }}, {{ .Message.UUID }} |
| Conversation reopened | The assigned agent | {{ .Message.Content }}, {{ .Message.UUID }} |
| SLA breach warning | The alert recipients of the SLA policy | {{ .SLA.Metric }}, {{ .SLA.DueIn }} (time left) |
| SLA breached | The alert recipients of the SLA policy | {{ .SLA.Metric }}, {{ .SLA.OverdueBy }} (time past the deadline) |
| CSAT request | The customer | {{ .CSATLink }}, {{ .CSATUUID }} |
In the seven templates for agents, Recipient is the agent and the Conversation variables are available. The Contact variables are there too, except in the two SLA templates, where {{ .Conversation.Priority }} is also empty. Author is empty, except in the three reply templates, where it is the customer who wrote. Use only the variables a template offers. One it does not have shows up as <no value> in the email, and when it is passed to a function such as L.Ts, the email is not sent at all. When each email is sent is explained in Notifications and the EPAV mailbox.
How notification emails are wrapped
The default outgoing template frames the notification emails too. Without one, they get the platform's own frame with your site name and the footer line. Emails from the rule action Notify agents are framed the same way.
The CSAT request
The CSAT request goes to the customer as an ordinary reply in the conversation, so the outgoing template frames it and it has every variable of a reply. {{ .Author.* }} is whoever resolved the conversation: an agent, or the AI assistant (then {{ .IsAIComposed }} is true); it is empty when a rule resolved the conversation or sent the survey.
Its built-in text is in English («Your conversation #... has been resolved», a question and five rating links from Poor to Excellent) and does not follow the platform language. If your customers write in another language, rewrite it in theirs.
{{ .CSATLink }} is the address of the rating page. Add ?rating=1 up to ?rating=5 to open the page with that rating already chosen: one click in the email, and the customer only has to send it, with a comment if they like. Surveys in other channels are described in Macros, tags, SLA and business hours.
Texts in the platform language
The seven built-in templates for agents take their wording from the platform dictionary, so the emails follow the language set in Admin > Workspace > General and carry your site name instead of any other brand. A template you have edited keeps your text when the platform is updated. In SLA emails, {{ .SLA.Metric }} (First response, Resolution or Next response) and the times in {{ .SLA.DueIn }} and {{ .SLA.OverdueBy }} are always in English.
Reset to default
A built-in template you have changed can be brought back: open it and press Reset to default next to Save. The editor gets the original body back; for the seven templates for agents that is our text from the platform dictionary, so the email follows the site language again. The subject stays as it is, and nothing changes until you press Save.
Every outgoing template has the button too. It puts a ready layout into the editor: your logo ({{ LogoURL }}), or your site name when there is no logo, a greeting with the customer's first name, the reply, and a sign-off with the first name of whoever wrote it. The greeting and the sign-off come from the platform dictionary, so they are in the platform language. Edit it as you like before you press Save, and tell your agents not to greet and sign off themselves.