Question
How are incoming emails threaded to tickets?
Answer
When an inbound email is received, Zendesk checks the email for references to existing tickets. This determines whether the email will be added as a ticket update or if a new ticket is created.
Zendesk checks three main references for threading emails:
- Elements in the email header
- Encoded IDs in the message body
- Encoded IDs in the Zendesk receiving address
Elements in the email header
In the email header, the References
and In-Reply-To
lines contain the message IDs for other emails in the same thread. Zendesk checks these message IDs on existing tickets. If Zendesk finds a match, the email is added as a reply to the matching ticket.
The email header is visible in the email source. See the article: Viewing the HTML and original source for incoming tickets.
For more information about troubleshooting email headers, see the article: Why do emails thread to the wrong ticket?
Encoded IDs in the message body
An encoded ID is a unique reference to a specific ticket. Zendesk includes an encoded ID by default in every outbound notification email, which helps match replies to the correct ticket.
An encoded ID can be added to any email body and is not exclusive to emails generated by Zendesk. The encoded ID must appear inside square brackets, for example,[1G7EOR-0Q2J]
, in order for Zendesk to detect it.
Encoded IDs in the Zendesk receiving address
Zendesk support email addresses may use aliases that include the encoded ID. For example, the email address for a ticket with encoded ID 1G7EOR-0Q2J
in the mondocam
subdomain would appear like this: support+id1G7EOR-0Q2J@mondocam.zendesk.com
.
This structure helps ensure that the email threads to the corresponding ticket, even if no other references are present.
This use of encoded IDs only works for Zendesk support email addresses and does not apply to external support addresses.
How to access the encoded ID
You can find the encoded ID of a ticket by following the steps below:
- Use the
{{ticket.encoded_id}}
placeholder in macros or ticket comments to show the encoded ID - Use the Tickets API to view the
encoded_id
parameter. This approach allows API workflows to access the encoded ID without manipulating ticket comments.
Conversation ID
from the email body, and not Reference
or In-Reply-To
in the email header.