AnsweredAssumed Answered

How do I identify the email that created the case?

Question asked by Francesca Shiekh on Sep 9, 2014
Latest reply on Jun 30, 2016 by Gaelle Fernandez
SugarCRM 6.5.15 soon to be 6.5.17

When a case is created by an email I want to trigger an after_relationship_add logic hook.
This triggers when the email is related to the case (I can check the arguments to make sure it's Case<->Email), but I want this to execute ONLY if the email that was just related to the case is the one that just generated the case in the first place (I'm removing all customizations from a non upgrade safe InboundEmail.php). I.e. this is a new case.

How can I identify this as "The" email that created the case as opposed to emails that are part of an ongoing communication? Cases can be generated by things other than emails (web forms, hand entry) so counting emails not good enough.