Spring 25: Transition to New Email Threading Behavior

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.

  1. 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.
  2. If you use merge fields in email templates, replace Case.Thread_Id with the merge field Case.Thread_Token.
  3. In your org’s custom code, replace Cases.getCaseIdFromEmailThreadId wherever it occurs with Cases.getCaseIdFromEmailHeadersEmailMessages.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 ?

  1. 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.
  2. Update email templates : Replace Case.Thread_Id with Case.Thread_Token in all email templates where this merge field is used.
  3. 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
  4. Test thoroughly to ensure correct email-to-case associations.
  5. Communicate changes to all relevant stakeholders.
  6. Monitor the system for issues and troubleshoot as needed.
  7. Plan and execute a full transition to the new threading system.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top