You are here:
How Email Activity Matches with Other Records
When Sync Email as Salesforce Activity is turned on, Einstein Activity Capture tries to associate each address in the From, To, and CC on the email to user, contact, or lead records. The addresses and related activity are also matched with account and opportunity records. The default matching logic considers record ownership, recent activity, and other factors to connect new addresses and activity to your existing data.
Required Editions
| Available in: Lightning Experience |
| Available with Einstein Activity Capture Standard in Sales in Starter, Pro Suite, Professional, and Enterprise Editions |
| Available with Unlimited Edition, Einstein 1 Sales Edition, and Agentforce 1 Edition |
| Available with Einstein for Sales, which is included in Einstein 1 Sales Edition and available for an extra cost in Enterprise and Unlimited Editions |
| Available with Sales Engagement, which is included with Sales in Performance and Unlimited Editions, and available for an extra cost in Professional and Enterprise Editions |
| Available with Revenue Intelligence, which is available for an extra cost in Enterprise and Unlimited Editions |
Email addresses are matched upon first detection, including in replies. On existing email threads, only addresses for newly added recipients are matched. Original recipients retain their existing record associations.
Email replies inherit account and opportunity associations from the parent email message. If the parent email doesn’t have associations and a new email address is added to a reply, the matching process looks for an account or opportunity for the new address based on the matched user, contact, or lead or the address domain.
User Records
Email addresses are checked against active users. If there aren’t any active users, the connected account owner is used. If no active users or connected account owners match, inactive users are considered. If still no users match, the email addresses are considered as possible matches for contacts and leads.
API-only and users associated with automated processes aren’t considered.
Contact and Lead Records
Email addresses that don’t match user records are reviewed to match contact or lead records. Contacts are reviewed for matches before leads. Only one contact or lead record is matched to each email address on a message.
If multiple contact or lead records have the same email address, this criteria determines the match.
- Partner account (if turned on): The contact is associated with an account record that matches the partner account.
- Account owner: The contact record’s related account is owned by the matched user.
- Contact owner: The contact is owned by the matched user.
- Privacy check: Private contacts not owned by a matched user are excluded to protect data visibility.
- Recent activity: A contact with the most recent LastActivityDate is prioritized.
- Last modified: As a final selection tiebreaker, the contact with the most recent LastModifiedDate is matched.
If an address remains unmatched, it’s suggested as a new contact. If no new contact is created, the address is stored on the email message record without a relation.
Account Records
Account records that are related to matched contacts are considered. If multiple accounts qualify, this criteria determines which record matches to the email message.
- Partner account (if turned on): Only partner accounts are considered.
- Most contacts: The account record with the greatest number of associated contacts is selected.
- Recent activity: An account with the most recent LastActivityDate is prioritized.
- Last modified: As a final selection tiebreaker, the account with the most recent LastModifiedDate is matched.
If an email can’t be matched to an account by using an existing contact, the domain from the email address is checked against the website field on all account records. An account is matched if the email domain (or subdomain) is found in the website field value. For example, the email address example@salesforce.com matches the website field values www.salesforce.com and www.help.salesforce.com.
Opportunity Records
After email activity matches to accounts, opportunity records are considered for matching. If an email already matched to an account also matches with an opportunity, the opportunity relationship takes precedence. The direct relationship to the account is replaced with a relationship to the opportunity.
Opportunity matches are determined by this criteria.
- Close date: The close date is 60 days or more after the email activity occurs.
- Owner: The opportunity owner is included in the email.
- Account owner: The related account is owned by a matched user.
- Created date: The opportunity was created no more than 60 days after the email activity date.
- Activity window: The activity date falls between the opportunity’s create and close dates.
- Status: An open opportunity is selected before a closed one.
- Close date: An opportunity with an earlier close date is selected before one with a later date.
- Recent activity: An opportunity with the most recent LastActivityDate is prioritized.
- Last modified: As a final selection tiebreaker, the opportunity with the most recent LastModifiedDate is matched.
How Matching Works
The Activities: Match Email to Records flow controls the matching process. The flow automatically triggers when Einstein Activity Capture or Salesforce Inbox captures a new email message. These four default flow actions run in this order.
- Get Users from Email Address
- Get Contacts and Leads from Email Addresses
- Get Account and Opportunity from Email Addresses
- Create Email Activity with Associations
Emails sent from the Salesforce Email Composer in Lightning Experience or the email application don’t use flow-based matching. They’re associated with the open user, contact, or lead records. The Activities: Match Email to Records flow doesn’t overwrite any manual association between an email and an activity.
Flow and platform limitations apply to Activities: Match Email to Salesforce Activity, including usage-based entitlements, per-transaction flow limits, and object access requirements.
Customize Matching Rules
To customize matching, edit the default flow actions by using Flow Builder. Select the Activities Match category, and search for the appropriate action. For example, add criteria to make sure that emails match to a customer account record instead of a partner account.
Use Apex to create additional custom matching rules for specific use cases. For example:
- Block certain emails from being logged based on information available in the flow.
- Use custom email addresses instead of standard email addresses.
- Skip or change the object records to match and use, for example, custom objects.
- Create your own tiebreaker for when the flow matches an email to multiple records.

