Skip to main content

How can organizations using Einstein Activity Capture (EAC) in Salesforce reliably classify email activities as inbound vs outbound, given that outbound emails are logged as "Email:", inbound replies as "Email RE:" or "Email re:", and all subsequent thread replies continue using the "Email RE:" format? I've tried using the EmailMessage object, but the activity sits in the Tasks object which doesn't bring in the "From Address" field.   

1 answer
  1. Mar 26, 11:19 PM

    @Debanand Pati

     

    This is one of the more frustrating gaps in EAC's data model, and the subject prefix approach you've been trying ("Email RE:" vs "Email:") is brittle for exactly the reason you identified. Once a thread starts, everything gets "RE:" regardless of direction. Here's how to actually solve it.

    The right field to use is "Incoming" on the EmailMessage object.

    When you enable "Sync Email as Salesforce Activity" (Summer '25 for new orgs, or for existing orgs that've had EAC reset by Support), EAC writes emails as proper EmailMessage records in the Salesforce database.  

    That object has an Incoming boolean field = true for inbound, = false for outbound, which is exactly the classification you need. No subject parsing required. 

    Flip Incoming = false for outbound. You can also join back to the Task via ActivityId if you need to cross-reference with other activity data.

    Now, the catch you need to be aware of. If your org enabled EAC before Summer '25 and hasn't been reset, emails are still living in AWS, not as real EmailMessage records. In that state, the EmailMessage query above returns nothing for EAC-captured emails because they simply don't exist as platform records yet. That's why the Task approach felt like a dead end. Tasks were all you had, and Tasks don't carry FromAddress or the Incoming flag.

    If you're in that older EAC setup, your options are:

    Contact Salesforce Support to reset and re-enable EAC under the Summer '25 architecture. This gives you the new EmailMessage-based sync going forward. Historical data won't migrate automatically (Salesforce is still working on that tooling), but new emails will be properly classifiable.

    In the meantime, for existing Task-based data, the subject prefix approach is the only native handle you have, but you can make it slightly less fragile. Match on whether the Task's assigned user OwnerId matches the sender. If the rep is the owner and the email subject starts with "Email:", it's outbound. If the subject starts with "Email RE:" and the rep is the owner, it's likely an inbound reply. Not perfect, but it gets you to around 85% accuracy on clean threads.

    The real fix is getting onto the Summer '25 data model. Once you're there, Incoming on EmailMessage is clean, reliable, and reportable natively without any subject parsing workarounds. 

     

    I hope this answers your doubts. thanks! 

0/9000