You are here:
How Email Data Matches to Other Records
Momentum tries to associate each email address in the From, To, and CC fields to a user, contact, or lead record. 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.
An email address is matched on first detection, including in replies. For an existing email thread, only the addresses for newly added recipients are matched. The original recipients retain their existing record associations.
An email reply inherits 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 approach ensures that a migrated email thread is 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 in 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. As long as these messages aren’t deleted, you can find them in your org by using global search until you or a user deletes them.
Contact and Lead Records
If an email address doesn’t match a user record, the system tries to match it first to a contact record and then to a lead record. 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 are excluded to protect data visibility.
- Recent activity: A contact with the most recent LastActivityDate is prioritized.
- Last modified: As a tiebreaker, the contact with the most recent LastModifiedDate is matched.
If an address remains unmatched, it’s suggested as a new contact. If a contact record isn’t 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 for association. 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 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.
- Contact Role matching: An opportunity is matched via a contact who is assigned any contact role on the opportunity.
- Account-based matching: If no opportunity is matched through a contact role, the opportunity is 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, this criteria determines which record matches.
- Close date: An opportunity is excluded if its close date is more than 60 days before the email activity date.
- 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 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 that you want the email associated with, manually update the association from the email record.
How Matching Works
The Activities: Match Email to Records flow controls the matching process. The flow triggers when Momentum 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 a 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
In Flow Builder, edit the default flow actions in the Activities Match category, and search for the appropriate action. For example, add criteria to match emails to a customer account record instead of a partner account.
For specific use cases, use Apex to create custom matching rules. For example:
- Block logging certain emails based on information available in the flow.
- Match custom email address fields instead of the default.
- Skip or change the object records to match and use, for example, custom objects.
- Create your own tiebreaker if the flow matches an email to multiple records.
