With the new Email-to-Case threading behavior, incoming emails aren’t matched using Ref IDs. Instead, they are matched using a new secure token in the email subject or body. If no match is found, we also check metadata that’s contained in the email headers.
Email-to-Case is backward compatible until you turn on Lightning threading.
- If Do Not Auto-enable New Features is off, Salesforce will set email preferences for threading tokens based on the corresponding Ref ID settings for email subjects and bodies.
- If you use merge fields in email templates, replace Case.Thread_Id with the merge field Case.Thread_Token.
- In your org’s custom code, replace Cases.getCaseIdFromEmailThreadId wherever it occurs with Cases.getCaseIdFromEmailHeaders, EmailMessages.getRecordIdFromEmail, or a combination of both.
During the transition, existing emails associated with your cases may contain both Ref ID and email threading tokens.
What is the benefit of this update?
- To match emails to corresponding cases, Lightning threading combines token- and header-based threading. Similar to Ref ID threading, token-based threading inserts a formatted string into the email body or subject, but is now generated in a way that meets Salesforce security standards. When Lightning threading is enabled, new outbound emails don’t include a Ref ID.
WHat are the next steps ?
- Review changes and settings.
- Backward Compatibility: Ensure that Lightning threading is not turned on prematurely.
- Automatic Setting Adjustments: Check if the “Do Not Auto-enable New Features” setting is off. If so, email preferences for threading tokens will be set based on current Ref ID settings.
- Update email templates : Replace
Case.Thread_Id
withCase.Thread_Token
in all email templates where this merge field is used. - Modify custom code to use new methods for email threading. Identify and replace all instances of
Cases.getCaseIdFromEmailThreadId
with the following methods:Cases.getCaseIdFromEmailHeaders
EmailMessages.getRecordIdFromEmail
- Test thoroughly to ensure correct email-to-case associations.
- Communicate changes to all relevant stakeholders.
- Monitor the system for issues and troubleshoot as needed.
- Plan and execute a full transition to the new threading system.