Skip to main content
Outgoing emails can include expressions like {{ .Recipient.FullName }}, which pull fields from the conversation, contact, inbox, recipient, and author. libredesk replaces them with real values when it sends the email.

Outgoing email templates

Edit outgoing templates under Admin → Templates → Outgoing email templates. You can create several, but only the one marked Is default is used. It wraps every email sent in a conversation: agent replies, AI assistant replies, CSAT requests, and conversation continuity emails. Notification emails to agents do not use it. See Email notification templates.

Available variables

Conversation variables

Inbox variables

Contact variables

Recipient variables

The recipient is whoever receives the email. In replies to conversations, Recipient and Contact are the same person. They differ only in email notification templates, where the recipient is an agent.

Author variables

The author is the sender of the message. When libredesk itself sends the email (automations, conversation continuity), the sender is the built-in System user, so these fields stay empty. Emails would otherwise show “System” as the author’s name.

Message variables

Use them to disclose AI replies, or to skip parts of the template that don’t fit an automated email:

Previous messages

{{ .PreviousMessages }} lists up to 10 earlier messages exchanged with the contact in this conversation, newest first. Use it to quote the conversation history below a reply. Private notes and failed messages are left out. Each item has these fields:
To quote only the contact’s last message, and only in some inboxes, check the item’s position, .IsIncoming and .Inbox.Name. eq returns true when the first value matches any of the others, so list as many inbox names as you need:
Quoted messages include all text of each incoming email except its own quoted history. Text that your systems add to an incoming email for agents, such as account details from a contact form, is sent back to the contact. Store that information in custom attributes instead.

Template functions

These work in any template, alongside the variables above.

Using variables in replies and private notes

The same expressions work when an agent types them in the reply editor or a private note, and in macros. libredesk replaces them when the message is saved, so the agent sees the final text right away.

Example outgoing email template

Templates support HTML formatting. Use tags like <p> and <br /> to control spacing and line breaks. Plain text without HTML tags renders without line breaks.

Full HTML example

This template adds a logo header, the conversation history below the reply, and a footer. Replace the footer text with your own.

How the template wraps a message

The template wraps every message an agent sends. Whatever the agent types in the editor goes where {{ template "content" . }} sits. So if the template already opens with “Dear {{ .Recipient.FirstName }}” and closes with “Best regards, {{ .Author.FullName }}”, agents should write neither a greeting nor a sign-off. They write only the body.

Correct usage

Message written in text editor:
Email received by customer:

Duplicated greeting and sign-off

Message written in text editor:
Email received by customer (with unwanted duplication):

Other template shapes

A template with no greeting means agents write their own. A template that is only the content placeholder means agents write the whole email, greeting and sign-off included. Read the active template before deciding what to write.

Email notification templates

Edit these under Admin → Templates → Email notification templates. The subject line takes the same expressions as the body. These emails use a built-in layout. The CSAT request is the exception and uses the default outgoing email template. Every template gets the Conversation, Contact, Inbox, and Recipient variables. All except the CSAT request go to agents, so {{ .Recipient.* }} is the agent being notified.
In the CSAT request, {{ .Author.* }} holds the person who resolved the conversation, and is empty when an automation resolved it.