> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open.cx/llms.txt
> Use this file to discover all available pages before exploring further.

# Reply Templates

> Wrap every email reply in your own HTML template and sign it per agent, with name, job title and email variables that adapt to who replied.

Every reply sent from an email address connected to OpenCX, whether the AI or a teammate wrote it, is wrapped in that address's **HTML template**. The template is also where the signature goes: its variables fill in the teammate who replied, so each agent signs their own emails from one shared layout.

## Where to edit it

* **Template:** open the address under **[Channels → Email](https://platform.open.cx/channels/configure/mail)**. The editor lists every variable and previews the result with sample values. You can also ask the Companion to write it, or use the [email channels API](https://docs.open.cx/api-reference/email/patch_channels.md).

* **Each teammate's job title:** set by the teammate in **Settings → My Profile**, or by an admin from the edit dialog on the **Members** page.

* **Work phone and Profile link** are optional. Each teammate can save them in **Settings → My Profile** for this workspace. The link can point to any HTTPS professional profile.

Without a custom template, OpenCX uses a simple default layout.

## Variables

| Variable | Value |
| - | - |
| `{{content}}` | **Required.** The reply itself |
| `{{agent_name}}` | The teammate who replied (or the session's assignee). Their alias when one is set |
| `{{agent_title}}` | That teammate's job title |
| `{{agent_email}}` | That teammate's email address. Empty when an alias is set, so the alias isn't unmasked. Showing agents' first names only does not hide it |
| `{{agent_phone}}` | The teammate's work phone, including formatting and extensions. Empty when unset or when an alias is active |
| `{{agent_profile_url}}` | The teammate's HTTPS profile link. Empty when unset or when an alias is active |
| `{{ticket_number}}` | The session's ticket number |
| `{{zendesk_ticket_id}}` | The linked Zendesk ticket ID; empty without one |
| `{{session.language}}` | The session's language code, such as `en` or `ar` |
| `{{quoted_content}}` | The earlier messages, quoted. Adding it turns inline history on |

> [!WARNING]
>
> The `agent_*` variables are **empty while only the AI has handled a session**. Wrap a personal sign-off in a condition, or AI replies will end with a blank name line.

## Sign each reply as the agent

```html theme={"dark"}
<div>{{content}}</div>
{{#if agent_name}}
  <p>
    <strong>{{agent_name}}</strong>
    {{#if agent_title}}<br />{{agent_title}}{{/if}}
    {{#if agent_phone}}<br />{{agent_phone}}{{/if}}
    {{#if agent_profile_url}}<br /><a href="{{agent_profile_url}}">View my profile</a>{{/if}}
    {{#if agent_email}}<br /><a href="mailto:{{agent_email}}">{{agent_email}}</a>{{/if}}
  </p>
{{else}}
  <p>The Support Team</p>
{{/if}}
```

Conditions support `{{#if …}}`, `{{elseif …}}`, `{{else}}` and `{{/if}}`, with `==`, `!=`, `&&`, `||` and `!`, for example `{{#if session.language == "ar"}}`.

## Show the agent's name as the sender

Customers normally see the address's **Sender name** as the sender of every email. A teammate can turn on **Send emails under your name** in [**Settings → Personalization**](https://docs.open.cx/ticketing/personalization.md#set-your-inbox-preferences), and the emails they send then show their name first:

| Who sent it | Sender the customer sees |
| - | - |
| The AI, or a teammate with the option off | Acme Support |
| A teammate with the option on | Dana from Acme Support |

The email address stays the same, and so does the template. Because the teammate's name is followed by "from" and your **Sender name**, set a **Sender name** that reads well after "from", such as your company name. An address with no **Sender name** uses your workspace name.

## Tips

* Use tables and inline `style` attributes for layout; many mail clients ignore `<style>` blocks.
* Host logos and images at a public URL rather than embedding them; many mail clients block embedded images.
* Saving a template applies to the next reply from that address. Send yourself a test reply to check it in a real mail client.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.