Skip to main content

Email 2 Case Critical Update "Disable Ref ID and Transition to New Email Threading Behavior" and sending Emails through Apex gap.

 

Hello guys,

 

New Threading Behavior is a very exciting feature, we want to introduce it ASAP, so we started testing it and I think that we have found a gap. 

From what I understand, the new behaviour works as following:

  • Email is received on E2C.
  • Information from header: In-Reply-To, References are being matched with MessageIdentifier field on EmailMessage object.
  • If values have been matched, then EmailMessage received on E2C is linked to an existing Case (that is Parent of matched EmailMessage). Otherwise, new Case gets created.

This works perfectly fine with responses to Emails created via Standard features (Case auto-response, Send Email quick action) as MessageIdentifier field gets correctly populated for the emails send.

 

However, in our org we have some other complex scenarios where we require to send emails via Apex. We have tested 2 methods from Messaging class:

  • Messaging.sendEmail(emails, allOrNothing) - we send SingleEmailMessage and then create EmailMessage object based on it (connected to Case via ParentId). 
  • Messaging.sendEmailMessage(emailMessageIds, allOrNothing) - We insert EmailMessage as a draft and then send it using this method.

Neither of those ways gives us any opportunity to populate MessageIdentifier field on EmailMessage object, as it seems that this information is not avaliable in Apex. Moreover, it seems that MessageIdentifier is Read Only (if you populate it programatically before inserting the EmailMessage, it is set to '' anyway.

 

Is my reasoning correct? Are there any enchancements to facilitate that scenario planned before "Disable Ref ID and Transition to New Email Threading Behavior" critical update is enforced? Does it mean that responses to EmailMessages sent via Apex won't work with E2C New Email Threading Behavior?

 

CC: @Zakaria Aoujil @Piotr Wyszynski @Dominik Ryczek

5 comentários
  1. 5 de jan. de 2022, 11:54
    • I'm getting : In-Reply-To, References are being matched with MessageIdentifier field on EmailMessage object.
    • Parent Id not getting . I'm getting : In-Reply-To, References are being matched with MessageIdentifier field on EmailMessage object.Parent Id not getting . What to Do ??? So pls guide...
    • What to Do ???  So  pls guide... 
0/9000