Loading

How On-Demand Email-to-Case Associates Inbound Emails to Cases Using Thread IDs

게시 일자: May 29, 2026
상세 설명

This article explains the logic Salesforce uses to associate inbound emails with existing Cases when a thread ID (also called a Ref ID) is present in the email body or subject line.
On-Demand Email-to-Case is a Salesforce feature that routes inbound customer emails to Case records using your organization's Mail Transfer Agent (MTA). When a customer replies to a case-related email, Salesforce looks for a thread ID embedded in the email to match it back to the correct Case automatically.

솔루션
When an email enters the incoming MTAs (Mail Transfer Agents), the email services code checks the email for an existing thread ID to associate the email with an existing Case.
### Thread ID Check Sequence
The system checks for the thread ID in the following order:
  1. The email Subject line is checked for the thread ID first.
  2. If the thread ID is not found in the Subject, the plain Text Body of the email is parsed.
  3. If the thread ID is not found in the Text Body, the HTML Body of the email is converted to plain text using a utility method, and then checked for the thread ID.
### Thread ID Format
The system extracts the thread ID by looking for any string between the delimiters ref: and :ref.
Example of a thread ID:
ref:_00D30oKPx._50030bwIii:ref
### Handling Multiple Thread IDs
If multiple thread IDs are included in the email header or body, the email attaches to the Case represented by the first thread ID found in the string.
Example:
[ ref:_00D30oKPx._50030bwIii:ref ] [ ref:_00D30oKPx._50030bMuaN:ref ]
In this example, the email attaches to the Case represented by ref:_00D30oKPx._50030bwIii:ref because it appears first.

Emails are not added to a Case when customer responds
Knowledge 기사 번호

000382674

 
로드 중
Salesforce Help | Article