---
schema_version: "1"
id: 1361abec5e24b460600cb85e92ab97a4cfac8ad5740cc790a951efc042625504
title: How Email Activity Matches with Other Records
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/sales/264-0-0/eac_email_activity_flow.md
canonical_url: https://help.salesforce.com/s/articleView?id=sales.eac_email_activity_flow.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 40c18a2a9c2b8f0a7b1a78503ea17d22309271503f4d37efd4a556560720b398
description: Einstein Activity Capture tries to associate each address in the From, To, and CC on an 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.
products:
  - Sales Cloud
  - Cross Cloud
  - Service Cloud Voice
release: "264"
---
# How Email Activity Matches with Other Records

Einstein Activity Capture tries to associate each address in the From, To, and CC on an 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

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available with Einstein Activity Capture Standard in Sales in <strong>Starter</strong>, <strong>Pro Suite</strong>, <strong>Professional</strong>, and <strong>Enterprise</strong> Editions</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available with <strong>Unlimited </strong>Edition, <strong>Einstein 1 Sales Edition</strong>, and <strong>Agentforce 1 Edition</strong></td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available with Einstein for Sales, which is included in <strong>Einstein 1 Sales Edition</strong> and available for an extra cost in <strong>Enterprise</strong> and <strong>Unlimited</strong> Editions</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available with Sales Engagement, which is included with Sales in <strong>Performance</strong> and <strong>Unlimited</strong> Editions, and available for an extra cost in <strong>Professional</strong> and <strong>Enterprise</strong> Editions</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available with Revenue Intelligence, which is available for an extra cost in <strong>Enterprise</strong> and <strong>Unlimited</strong> Editions</td></tr></tbody></table>

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-sales-sales_productivity-264-0-0-production-enus/b2f6c36a-fa61-4a3c-9752-032ce1818a69/images/icon_note.png)

Note We’re reorganizing the Einstein Activity Capture documentation. We’re moving some information around, but we aren’t deleting anything.

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, opportunity, custom object, and case 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.

If an email is imported from migration and a direct reply relationship isn't available, it’s assigned an account or opportunity association from another email in the thread. This ensures that migrated email threads are linked to the correct records even when the reply chain metadata is incomplete.

Messages that include only internal email addresses aren’t synced. If an internal address and external address are detected on a message, only the external address is considered for the matching process.

Before September 2026, if a message only had internal email addresses and one or more matched to a contact, person account, or lead record, the message synced to Salesforce. These messages are available in your org and can be found using global search until you or a user deletes them.

## 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.

1. Partner account (if turned on): The contact is associated with an account record that matches the partner account.
2. Account owner: The contact record’s related account is owned by the matched user.
3. Contact owner: The contact is owned by the matched user.
4. Privacy check: Private contacts are excluded to protect data visibility.
5. Recent activity: A contact with the most recent LastActivityDate is prioritized.
6. 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. The address is stored on the email message record without a relation if no new contact is created.

## 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.

1. Partner account (if turned on): Only partner accounts are considered.
2. Most contacts: The account record with the greatest number of associated contacts is selected.
3. Recent activity: An account with the most recent LastActivityDate is prioritized.
4. 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 contacts and accounts, opportunity records are considered for matching. Opportunities are matched in two stages:

1. Contact Role matching: An opportunity is matched via a contact who is assigned any contact role on the opportunity.
2. Account-based matching: If no opportunity is matched through a contact role, opportunities are matched using the related account.

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.

Within each stage, candidates are narrowed using the following criteria in order:

1. Close date: An opportunity is excluded if its close date is more than 60 days before the email activity date.
2. Owner: The opportunity owner is included in the email.
3. Account owner: The related account is owned by a matched user.
4. Created date: The opportunity was created no more than 60 days after the email activity date.
5. Activity window: The activity date falls between the opportunity’s create and close dates.
6. Status: An open opportunity is selected before a closed one.
7. Close date: An opportunity with an earlier close date is selected before one with a later date.
8. Recent activity: An opportunity with the most recent LastActivityDate is prioritized.
9. Last modified: As a final selection tiebreaker, the opportunity with the most recent LastModifiedDate is matched.

An email can match an older or recently closed opportunity instead of a newer one. If the auto-matched opportunity isn’t the deal you want the email associated with, manually update the association from the email record.

## How Matching Works

The [Activities: Match Email to Records flow](https://help.salesforce.com/s/articleView?id=platform.flow_ref_elements_actions_activities.htm&type=5&language=en_US) 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.

1. Get Users from Email Address
2. Get Contacts and Leads from Email Addresses
3. Get Account and Opportunity from Email Addresses
4. 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.

![Important](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-sales-sales_productivity-264-0-0-production-enus/b2f6c36a-fa61-4a3c-9752-032ce1818a69/images/icon_important.png)

Important Activities Match core actions don’t support system-run flows or automated process users. Activities Match core actions are executed in the context of the user, who is also referred to as the “context user.” The flow has the same access level as the context user.

## Customize Matching Rules

To customize matching, edit the default flow actions by using [Flow Builder](https://help.salesforce.com/s/articleView?id=platform.flow_build.htm&type=5&language=en_US). 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 more custom matching rules for specific use cases. For example:

- Block certain emails from being logged based on information available in the flow.
- Override the default standard email field matching to use custom email address fields instead.
- 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.

#### See Also

- [Guidelines for Using Sync Email as Salesforce Activity](https://help.salesforce.com/s/articleView?id=sales.eac_email_activity.htm&release=264.0.0&type=5 "When Sync Email as Salesforce Activity is enabled, Einstein Activity Capture captures and stores email data as Salesforce records. It gets associated with a relevant user, contact, or lead record and a related account or opportunity. You can use the email data in reports, workflows, and triggers and access the data through APIs. There’s also more privacy options for email capture and customizable flows for matching your email to other records.")
- [Activities Match Flow Core Actions](https://help.salesforce.com/s/articleView?id=platform.flow_ref_elements_actions_activities.htm&type=5&language=en_US)