function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sumanth v 18sumanth v 18 

duplicate cases via email-to-case

Does anyone share sample code on below requirement. 

I'm having an issue where we're getting multiple cases opened via one email thread. I know what the issue is, but I'm wondering if there are any best practices or something that can be put in place that help avoid this issue. Here is what happened:

1. Customer emailed Sales Tech directly. They go back and forth on email.
2. At some point our support email address is added to the cc field.
3. Everytime they reply all a new case is added.
I know this is because the thread ID is missing. Technically Sales Tech should wait for the email that a new case is received (which includes the Thread ID) and reply all to that (since it includes the contact)... then if they go back and forth on that it will track to one case.
Is there anything else that can be done/put in place in these cases? We don't have them often - but when they occur they are a pain. 
GhanshyamChoudhariGhanshyamChoudhari
In your email template, You can add case number(unique field)  in the email subject.so you can extract the case number from the subject and you can track this email belongs to which case.
sumanth v 18sumanth v 18
Hi Ghansyhyam, 

email to case
When users send email to sfsupport@xyz.com, a case gets created in SF. If we reply from the email related list then [ ref:_XXXXXXXXX:ref ] id will be associated to the email thread so that it avoids duplicate case creation though user add sfsupport@xyz.com in cc,To,body in further emails. if we don't reply from the email related list then duplicate cases are created. 

Thanks
Sumanth
Cogno BotsCogno Bots
Right, it is not expected of customer teams or internal Sales Tech teams to wait for the Salesforce email that contains thread id and continue discussion on that email. Standard email to case does not consider email threads and that's why new case gets created when support address is cc'ed.

There is already an idea posted here around the same issue:
https://success.salesforce.com/ideaView?id=08730000000fziZAAQ

A free appexchange solution "Cogno E2C" that addresses this issue. The app has capability to find email threads and append emails to the original case automatically.

Find more and get the app here: https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000FHBurUAH