Why is SFDC not appending the new email to the existing case in sandbox? We have setup a typical on demand Email-to-Case service, as we normally do, but in sandbox, because refresh of Sandbox does not bring through the production Email-to-Case services. (This is not our first rodeo).
Setup: Enhanced Email has been turned on. Email-to-Case Service Setup and Verified. Routing "Email Address" : email@example.com" is on gmail as a alias/group and happily redirects the emails to the Email-to-Case Service (hence the verification worked) Service email address : "sandbox@gsajdfnvs2osjdfnv...sadfv.cs57.case.sandbox.salesforce.com"
On a new case we send email to our firstname.lastname@example.org It includes the Ref Id in subject and body. We then respond to the received email using our colleagues inbox but replace the To address with the new redirect email address "email@example.com"
The email is received by Salesforce and by our group members inboxes. But Salesforce creates a new Case rather than appending it to the existing one of the same ref Id.
This is the same result as if we just sent an email to the salesforce service address including the Ref Id.
Why is SFDC not appending the new email to the existing case in sandbox?
UPDATE 18/7 : It seems that Enhanced Email is the Cause, well at least we turned it off and Email-to-Case start working again. So it definitely looks like a bug, because I cannot find anything documented about Enhanced Email causing significant changes to Email-to-Case. UPDATE 19/7 : It is not enhanced Email we tested again and found non enhanced email sceanrio to still not work. It was an org refresh, and it used to work before sandbox refresh.
As a side the enhanced email also causes our sadbox (yes that was on purpose) to create duplicate emailmessage records, the duplicate does not have a parent, any info on this weirdness would be useful, maybe this will need a new question, but I have also asked this of salesfarce :) and will relay the results.
This is the Thread Id equation we are using:
"ref:_" & LEFT($Organization.Id,5) & SUBSTITUTE(RIGHT($Organization.Id,11), "0", "" )& "._" & LEFT(Id,5) & SUBSTITUTE(Left(RIGHT(Id,10), 5), "0", "") & RIGHT(Id,5) & ":ref"