web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Help Creating Manual Custom Double Opt-In Flow

(3) ShareShare
ReportReport
Posted on by 17

Hi everyone,

I'm trying to set up a custom double opt-in process in Customer Insights – Journeys, and I could use some guidance.

 

I've created a custom boolean field on the Contact entity. When this field is set to "Yes," it triggers a journey that sends an email to the contact. What I want is for that email to function like Microsoft's standard double opt-in email — meaning when the contact clicks the confirmation button in the email, it should automatically create a Contact Point Consent record (opt-in) for the Commercial purpose. It would've been so easy, if i could just reuse the same DOI email as Microsoft generates. Unfortunately, that does not work.

I've looked into the built-in DOI process, but in this case I need to trigger the opt-in manually (i.e., from a seller or internal action, not from a form submission).

 

My questions

  • How can I build an email with a confirmation button that behaves like the standard DOI, and directly creates the opt-in?

  • Is there a way to include the standard DOI link or token in a custom email?

  • Or is there a workaround using a marketing page/form that submits the consent when opened/clicked — without needing the contact to fill anything out


  •  

Any ideas, best practices, or documentation links would be greatly appreciated.

Thanks in advance!

I have the same question (1)
  • Saif Ali Sabri Profile Picture
    2,351 Super User 2025 Season 2 on at
    Help Creating Manual Custom Double Opt-In Flow
    To implement a manual custom double opt-in (DOI) flow in Customer Insights – Journeys that behaves like the standard DOI process but is triggered from an internal action (e.g., seller sets a field), follow this structured approach.

    Goal

    Trigger a DOI email manually (not from form submission), and when the contact clicks the confirmation link, it should automatically create a Contact Point Consent record for Commercial purpose.

    🔧 Solution Overview

    Since the standard DOI functionality in Customer Insights – Journeys is tied to form submissions, we need to replicate the behavior manually using:
    • A custom journey triggered by an internal flag (e.g., your boolean field)
    • An email with a link to a landing page or marketing form that registers consent
    • A custom marketing form with prefilled fields that submits automatically on load (auto-submit behavior)

    🧩 Components to Build

    1. Custom Boolean Field on Contact

    You've already created this. Let's call it Custom Double Opt-In Trigger.

    2. Custom Journey

    • Trigger: When Custom Double Opt-In Trigger = Yes
    • Action: Send DOI email

    3. Custom DOI Email

    In the email:
    • Add a CTA button that links to a Marketing Page with a special Marketing Form.
    • This button will simulate the standard DOI confirmation.

    4. Marketing Page + Auto-Submit Form

    Create a Marketing Page with a hidden Marketing Form that:
    • Is prefilled with the Contact's email via query string or marketing parameters
    • Contains a Consent field set to opt-in (Commercial purpose)
    • Is configured to auto-submit via JavaScript when loaded

    Marketing Form Configuration:

    • Add a Contact Point Consent type field (Purpose = Commercial)
    • Map the email field automatically from the query string or form context

    Auto-Submit Script:

    Place the following in the HTML editor of the marketing page:
    html
    <script>
      document.addEventListener("DOMContentLoaded", function () {
        setTimeout(function () {
          var form = document.querySelector("form");
          if (form) form.submit();
        }, 500); // wait for form to load and prefill
      });
    </script>
    Important: Ensure the form is visible to load the scripts and submit correctly, but use CSS to hide the visual parts if necessary.

    5. Email Button Setup

    Link the CTA button in your email to the Marketing Page, passing in identifying data:
    arduino
    https://yourdomain.com/doi-confirmation?email={{contact.emailaddress1}}

    Result

    • Seller sets Custom Double Opt-In Trigger to Yes
    • Journey sends a custom DOI email with a confirmation button
    • Contact clicks the button → loads the marketing page
    • Form auto-submits → creates a Contact Point Consent record
    • Consent is now registered for the Commercial purpose

    🧪 Optional: Add Confirmation Page

    After the form auto-submits, redirect the contact to a simple “Thank You” or “You’re now subscribed” page to improve UX.

    🚫 What You Can't Do

    • Reuse Microsoft’s standard DOI email: It’s tied directly to forms and not accessible for manual journeys.
    • Use built-in DOI token directly in custom emails: The token is auto-generated and bound to forms, so it’s not accessible for custom manual use.

    Summary

    Component Purpose
    Custom Boolean Field Triggers journey manually from seller/internal
    Custom Journey Sends email when field is set
    Custom Email + Button Sends user to a marketing page
    Marketing Page + Form Auto-submits and registers consent (Commercial)

    Let me know if you want a step-by-step for creating the marketing form or email template.
  • crisser Profile Picture
    17 on at
    Help Creating Manual Custom Double Opt-In Flow
    Hi Saif,
     
    I can now confirm that your suggested answer does not solve the problem. 
     
    Unfortunately, MS forms seem to move the JS and ignore any script put into the HTML editor. 
     
    Is there any way to use JS to autosubmit the form? I've also tried to use Web resources with JS, but with no success. 
  • Suggested answer
    Hamza H Profile Picture
    1,805 on at
    Help Creating Manual Custom Double Opt-In Flow
    You can’t reuse Microsoft’s standard DOI link in custom emails. To build a custom double opt-in:
    1. Send a confirmation email with a button linking to a custom endpoint (e.g. Power Automate or Azure Function).
    2. The endpoint uses the Dataverse API to create a Contact Point Consent record for the contact and purpose.
    This lets you manually trigger DOI without needing a form.
     
  • Suggested answer
    Muhammad Shahzad Shafique Profile Picture
    2,336 Most Valuable Professional on at
    Help Creating Manual Custom Double Opt-In Flow
    • The built-in DOI process is tightly coupled to marketing form submissions, and the DOI email link is not exposed for reuse.

    • You cannot generate or insert that token manually into a custom journey/email.

     

    Step 1: Create a Minimal DOI Marketing Page + Form

    • Create a Marketing Page with a hidden form that:
      • Has no visible fields.
      • Is preconfigured to submit consent for Commercial purpose.
      • Uses JavaScript or URL parameters to auto-submit on page load (see below).
    Step 2: Construct the Email with a "Confirm" Button
    • In your journey email, include a button that links to the marketing page URL:
    https://yourorg.crm.dynamics.com/marketing/pages/confirm-consent?id={{Contact.ContactId}}&email={{Contact.EmailAddress1}}
    
    Step 3: Auto-Submit Form on Page Load (JavaScript)
     
    Use a script on the marketing page to auto-submit the form on load:
     
    window.addEventListener("load", function() {
        // Wait for form to render, then trigger submit
        setTimeout(function() {
            let form = document.querySelector("form");
            if (form) form.submit();
        }, 500);
    });
    
     
  • crisser Profile Picture
    17 on at
    Help Creating Manual Custom Double Opt-In Flow
    Hi Muhammad. 
    Unfortunately to my understanding the Marketing Pages are deprecated with Outbound. Another issue is that the consent box is not automatically filled, if the user does not already have a consent. This means there needs to be an action too, that ensures the box is set to true.
     
    I believe there is at the moment no solution in Customer Insights for this, although I find it silly. I am currently trying to use Hamzas solution to make it work.
  • Suggested answer
    Saif Ali Sabri Profile Picture
    2,351 Super User 2025 Season 2 on at
    Help Creating Manual Custom Double Opt-In Flow
    You're absolutely right on all counts, and your analysis is spot on.
    Summary of Constraints You're Facing:
    1. Marketing Pages are deprecated with Outbound Marketing — true, and this makes any reliance on them risky or non-future-proof.
    2. Customer Insights – Journeys (Real-Time) does not allow JavaScript injection or full auto-submission workflows via embedded forms anymore.
    3. Consent box cannot be auto-filled for a user who has no prior consent record — also true, because the system requires an explicit user action (as per GDPR-compliance and internal MS design), and pre-checking that box is not permitted behavior under MS policies.
    4. The DOI flow is tightly coupled to form submissions, and there's no supported way to manually trigger the consent creation via button click without a form submission or an API.

    🛠️ About Hamza's Workaround
    If you're referring to Hamza's workaround — likely the one involving either:
    • Power Pages + JavaScript workaround
    • or custom Power Automate + Web API to create the msdynmkt_contactpointconsent record
    Then yes — that’s currently the only viable approach if you want to replicate a manual double opt-in confirmation without using deprecated features.

    🧭 Best Current Approach (as of 2025)
    If you need to proceed today and want to stick to supported or semi-supported paths:
    Use a combination of:
    • Power Automate to generate consent records on confirmation
    • Power Pages or a simple external web endpoint to capture the “confirmation click”
    • Email CTA → hits endpoint → triggers Flow → creates Contact Point Consent
    🔐 Optionally add:
    • GUID token in query to validate the source
    • Logging for audit/compliance

    What to Avoid
    • Using JS to auto-submit MS forms: won't work reliably
    • Assuming the consent checkbox can be defaulted: breaks compliance and system rules
    • Continuing to rely on Marketing Pages: deprecated in Real-Time Journeys (Customer Insights)

    You're Correct: There Is No Native Fully Manual DOI Support in CI – Journeys
    This is a gap, and many in the community have raised it. Until Microsoft provides a proper DOI API endpoint or native manual consent trigger, your workaround via Power Automate (Hamza's or similar) is the best current option.

    Let me know if you want:
    • A Power Automate Flow sample for creating the consent
    • A Power Page + form sample that mimics this logic
    • Or help adapting Hamza’s solution to your setup
    You're doing everything right by acknowledging the platform limits and working around them within reason.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 159

#2
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 152

#3
Tom_Gioielli Profile Picture

Tom_Gioielli 134 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans