Loading

Syncing Contact and Lead Email Opt Out with Marketing Cloud Next Consent Using Flows

Date de publication: Jul 7, 2026
Description

Marketing Cloud Next manages email consent through a dedicated Consent layer, specifically Communication Subscription Consent records. The standard Salesforce Contact and Lead objects include an Email Opt Out field (also known as HasOptedOutOfEmail), but this field does not automatically sync with the Marketing Cloud Next Consent layer.
Without a custom configuration, a Contact or Lead that has opted out in Salesforce CRM may still receive marketing emails through Marketing Cloud Next, and vice versa — a contact who unsubscribes via a Marketing preference page may not have their opt-out reflected on the Contact or Lead record.
This article describes a two-Flow solution to bridge this gap. The solution works in both directions:

  1. CRM to Marketing Cloud Next: An Automation Event-Triggered Flow monitors the Email Opt Out field on Contact or Lead records and updates Communication Subscription Consent in Marketing Cloud Next.
  2. Marketing Cloud Next to CRM: A Data Cloud-Triggered Flow monitors changes to Marketing Cloud Next Consent records and updates the corresponding Contact or Lead record.

Résolution

Flow 1: Sync Email Opt Out from Contact or Lead to Marketing Cloud Next Consent

Overview

Use an Automation Event-Triggered Flow on the Contact or Lead object to listen for new records or changes to the Email Opt Out field, and update the Communication Subscription Consent record in Marketing Cloud Next.

Steps

  1. In Flows tab in Marketing, and create a new Automation Event-Triggered Flow.
  2. Configure the trigger:
    1. In the Event Library, select the event called Prospect, Lead, Contact or Related Record Change.
    2. Add any additional trigger conditions needed for your implementation (for example, filtering to only fire when the HasOptedOutOfEmail field changes).
  3. Add a Consent Request Action to the Flow. This action updates the Communication Subscription Consent record in Marketing Cloud Next with the opt-out status from the Contact or Lead record.
  4. (Optional) If your process requires Double Opt-In, add an email message step to the Flow to request confirmation of the opt-in before updating consent. See the related article: [How to Handle a Double Opt-In Process with Marketing Cloud Next] — add link when available.
  5. If you manage multiple channels (Email, SMS, WhatsApp) or multiple Communication Subscriptions, add Decision Actions to branch the Flow logic appropriately.
  6. Save and activate the Flow.

Flow 2: Sync Marketing Cloud Next Consent Changes Back to Contact or Lead

Overview

Use a Data Cloud-Triggered Flow to listen for changes to Marketing Cloud Next Consent records and update the Email Opt Out field on the corresponding Contact or Lead record.
Consent changes in Marketing Cloud Next can originate from several out-of-the-box tools:

  • Preference Page
  • Consent Import
  • Channel Update (for example, unsubscribe via email reply, or STOP keyword sent to SMS)
  • Consent Status Lightning Web Component (LWC)
  • Create Consent Flow Action

Steps

  1. In Salesforce Setup, navigate to Flow Builder and create a new Data Cloud-Triggered Flow.
  2. Configure the trigger to listen for updated records in Marketing Consent. Add any additional conditions needed for your implementation.
  3. Add an Update Records Action to the Flow. This action updates the HasOptedOutOfEmail field on the Contact or Lead record to reflect the current consent status in Marketing Cloud Next.
  4. If you manage multiple channels or Communication Subscriptions, add Decision Actions to branch the logic and update the correct records.
  5. Save and activate the Flow.

Further Considerations

  • Multiple channels and Communication Subscriptions: If your Marketing Cloud Next implementation uses channels beyond Email (such as SMS or WhatsApp), or manages multiple Communication Subscriptions, both Flows will require Decision Actions to handle each channel or subscription path. Plan this logic before building your Flows.
  • Flow trigger conditions: Both Flows should be reviewed carefully for trigger conditions to avoid unnecessary runs or infinite loops. For example, the Data Cloud-Triggered Flow updating the Contact or Lead record should not re-trigger Flow.
  • Custom DMO approach (legacy): An earlier version of this solution used a Custom Data Model Object (DMO) mapped to the Unified Individual as an intermediate step between the Record-Triggered Flow and the Data Cloud-Triggered Flow. The updated approach (using an Automation Event-Triggered Flow with the Consent Request Action) removes the need for this Custom DMO for most use cases. If you have an existing implementation using the Custom DMO pattern, evaluate whether migrating to the updated approach is appropriate for your org.
  • Double Opt-In: If your business requires double opt-in confirmation before updating consent, this can be added to Flow 1 using an email message step. See the related article on handling double opt-in with Marketing Cloud Next.
  • Product name pairing: "Flows" is a shared Salesforce platform term. In all communications about this solution, always pair the term "Flows" with "Salesforce Flows" or specify the Flow type (Automation Event-Triggered Flow, Data Cloud-Triggered Flow) to avoid ambiguity with other Salesforce products or features.

FAQ

Q: Why can't I just use the MessagingConsent.MessagingConsent or MessagingConsent.MessagingConsentV2 actions in my Flow? A: These actions do not correctly update the Marketing Cloud Next Consent layer over time and may result in consent records that fall out of sync. Use the Consent Request Action instead, as described in this article.
Q: Do I need both Flows, or can I just implement one direction? A: You can implement either Flow independently depending on your business needs. Flow 1 handles CRM-to-Marketing Cloud Next sync; Flow 2 handles Marketing Cloud Next-to-CRM sync. Implement both if you need bidirectional consent management.
Q: What happens if a contact unsubscribes via email reply or SMS STOP? A: These channel-level unsubscribes are processed by Marketing Cloud Next and update the Consent layer. In Flow 2 (the Data Cloud-Triggered Flow) will then detect the Consent change and update the Email Opt Out field on the Contact or Lead record accordingly.
Q: Is a Custom Data Model Object (DMO) still required? A: No. The updated solution (last revised June 2026) uses an Automation Event-Triggered Flow with the Consent Request Action, which eliminates the need for a Custom DMO for most standard implementations.


Numéro d’article de la base de connaissances

005386642

 
Chargement
Salesforce Help | Article