Have an interesting problem with Email To Case setup, scenario is User A sends an email to a support mailer and copys User B on it. Auto response would go to User A. If User B picks up the first email and responds to it asking either for an update or provide more information, since the first email does not have the RefId, the Email To Case agent would end up creating a duplicate case. Has anyone come across this problem, wondering what options I have to either not create duplicate cases or auto close the duplicate cases.

Here are couple of things we are looking as a way to address this. Both these options cause a significant query strain on the system so curious if there are other solutions.

1 - Trigger on email message to parse the Message Id from the email header and look for cases with the same message id. Caveat - not sure if all the email providers will add a message id in the header. 2 - Look for cases with the same email subject and recipients in a certain time frame (2 hrs, 5 hrs) to know if the current email is a duplicate or not.

  • Yep - we had this exact same issue. Since our case volume was low (< 5 per day), we addressed through training and slicing folks off the cc: list as much as possible. Support users self-cured because they hated merging cases caused by this issue. I thought about doing the options you suggested but did not think they would be reliable and would cause new issues.
    – cropredy
    May 6 '14 at 17:53
  • 1
    As stupid as it sounds: have you considered an autoreply that'd be sent to "From" and "CCs"? "Dear {!Contact.Name}, thx for your email, your case number is 123, we'll aim to respond in X days, if you have anything plz reply to this email, {!Case.Thread_Id} (plz do not remove this reference)"... Because of hitting "CCs" as well as "From" I think it couldn't be done with email alert, you'd have to use a trigger (still, you could use an email template so not a very big deal).
    – eyescream
    May 6 '14 at 22:52
  • @eyescream auto response to all the email recipients + trigger to identify duplicate cases based on message id and/or subject would probably end up being the way to fix this problem. I'll keep this post updated on the final solution.
    – DCBoy
    May 7 '14 at 2:08
  • (I had a minor brainfart here and was bit tired... Not really sure why I wrote "trigger", might be perfectly fine to do it in email service's code)
    – eyescream
    May 7 '14 at 4:46
  • 1
    @DCBoy thanks for sharing. The ability to 'Send response to all recipients' in the Auto-Response Rule is not new. We are using this for few years now. This is actually the root cause here - falks which were CCed on the auto-response, are replying to the original mail message, which is creating duplicate cases. I was able to find a solution for this, by implementing Email Service which the appropriate Apex code logic, mainly adapted from the following post: sforcehacks.blogspot.co.il/2012/01/…
    – iDog
    Jul 2 '17 at 6:27

Your Answer

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

Browse other questions tagged or ask your own question.