# Data attributes available for email templates

> Email templates have access to the following data in any Handlebars block.

Source: https://help.kustomer.com/en_us/data-attributes-email-templates-ryu7VTeSA

Last updated: 2026-10-12T23:46:09.916Z

Email templates have access to the following data in any Handlebars block:

*   [Agent Avatar](#agent-avatar)
*   [Draft data attributes](#draft-data)
*   [Customer data attributes](#customer-data)
*   [User data attributes](#user-data)
*   [Conversation data attributes](#conversation-data)
*   [Message data attributes](#message-data)

For more information about email templates, see [Custom email templates](https://help.kustomer.com/en_us/customize-email-templates-r1DrjNITb).

### Agent Avatar

You can dynamically populate an email template with the avatar of the respective user, or agent. Use the following template to insert the agent avatar:

{{#if user.avatarUrl}} <img style="height:100px;width:100px;" alt="25" src="{{user.avatarUrl}}"/>{{/if}}

**Notes:**

*   You can adjust the height and width of the avatar to fit your template.
*   The email template won't display an avatar if an agent avatar is unavailable.

### Draft data attributes

**Important:** Always include Draft data attributes to send the email draft typed by the agent. Email templates without these Draft Handlebars will send blank templates.

Handlebars template

Description

`{{draft.textBody}}`

Plain text body of the email draft

`{{draft.htmlBody}}`

Formatted HTML body of the email draft

  

### Customer data attributes  
  

Handlebars template

Description

`{{customer.email}}`

Primary email of the customer

`{{customer.name}}`

Full name of the customer

`{{customer.firstName}}`

First name of the customer, if available

`{{customer.lastName}}`

Last name, if available

`{{customer.id}}`

Unique ID of customer in Kustomer

`{{customer.custom.exampleCustomFieldStr}}`

Custom data attribute specific to the Customer Klass for your Kustomer organization.

  

### User data attributes  
  

Handlebars template

Description

`{{user.email}}`

Email address of the user, or agent

`{{user.emailSignature}}`

Email signature of the user, or agent

`{{user.name}}`

User's name (as it appears in Kustomer)

`{{user.displayName}}`

Public display name of the user, or agent. Defaults to the user's name if a display name is not set in Kustomer.

`{{user.id}}`

Unique ID of the user, or agent, in Kustomer

`{{user.avatarURL}}`

URL of the user, or agent's, avatar in Kustomer

  

**Note:** The email template won't display an avatar if an agent avatar is unavailable.

### Conversation data attributes  
  

Handlebars template

Description

`{{conversation.status}}`

Status of the conversation

`{{conversation.name}}`

Name, title, or subject of the conversation

`{{conversation.id}}`

Unique ID of the conversation in Kustomer

`{{conversation.custom.exampleCustomFieldStr}}`

Custom data attribute specific to the Conversation Klass for your Kustomer organization

  

### Message data attributes

The following examples assume the first (most recent) message, which always has an index of `[0]`. The second, or next recent message, will have an index of `[1]`.  
  
The Messages object is a list of historical messages in the Conversation object. You can loop over each message in the messages object with the built-in each Handlebars helper.

Handlebars template

Description

`{{messages.[0].channel}}`

Channel of the message

`{{messages.[0].body}}`

Body of the message

`{{messages.[0].direction}}`

Direction of the message (either inbound or outbound

`{{messages.[0].from}}`

Address from which the message was sent

`{{messages.[0].sentAt}}`

Date and time when the message was sent

`{{messages.[0].subject}}`

Subject of the message, if applicable

`{{messages[0].id}}`

Unique ID of the message in Kustomer

###   

****Unsubscribe and email preference variables****

The `{{unsubscribe_url}}` and `{{email_preferences_url}}` template variables do not auto-generate values in Kustomer email templates.

Emails sent through Kustomer are classified as ****transactional messages**** — one-to-one emails triggered by customer interactions. Because these are not mass marketing campaigns, the `{{unsubscribe_url}}` variable does not resolve to a working URL.

The `{{email_preferences_url}}` variable requires your organization to provide a URL that points to a self-hosted page where customers can manage their email preferences. This URL must be configured before the variable produces a working link.

****Recommended actions:****

*   Replace `{{unsubscribe_url}}` and `{{email_preferences_url}}` with static URLs pointing to pages your team hosts and manages.
*   If those pages are not ready, remove the variables from your template footer to avoid broken links.

### Related articles

*   [Custom email templates](https://help.kustomer.com/en_us/custom-email-templates-r1DrjNITb)
*   [Create an email template](https://help.kustomer.com/en_us/create-an-email-template-H1EbPTerC)
