So we have a scenario where we are utilising Email-To-Case and it works perfectly for the most part, however, we have a client which uses a system which doesn't reply to the emails from us directly. Causing the thread id to be lost.

This client always has their own support ticket number in the subject header and it'll be the same for the issue. How could i utilize that subject header to combine the emails into one case as they come in?


Did you tried to check In EmailMessage trigger if email is incoming and has a Support Ticket. You can fetch the case with the support ticket and insert the corresponding thread Id in the body of the incoming email from the client. I believe this should work.

  • That's what i've tried. If you see here i've reference it: eMsg.ThreadIdentifier = c[0].Thread_Id__c; and i've done List<Case> c = [select Id from Case where Subject = :jsondata LIMIT 1]; Aug 10 '20 at 12:44

The only way to deal with this was to create a custom email handler, please look into this in sources such as http://sforcehacks.blogspot.com/2012/01/email-to-case-custom-email-handler.html

  • 1
    Since links have a tendency to go bad over time, you should include the important parts from the article in your answer here.
    – Derek F
    Jan 21 at 12:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.