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,...
Answered

SMS message unsubscribe functionality

(6) ShareShare
ReportReport
Posted on by 59
Hello community, 

Hoping someone here can help us clarify what we're supposed to do. 

We are activating SMS via Twilio, so far transactional messages work just fine however for commercial messages we are trying to add keywords to the message to handle the unsubscribe functionality.

We have created branches  on our journey so that when someone replies with STOP we move them down that branch,  however I am not sure what the expected behavior is supposed to be after that. 

Currently Twilio seems to be taking over and replies with their own unsubscribe message, this keeps the unsubscribe on twilio's side and doesn't update anything on Customer Insights Journeys.


1) Is Customer insights journeys supposed to take over the unsubscribe functionality from Twilio? 

2) Once someone replies STOP to our commercial message are we supposed to build a custom trigger to update the contact point consent record ?  
I have the same question (0)
  • Suggested answer
    Muhammad Shahzad Shafique Profile Picture
    2,336 Most Valuable Professional on at
    SMS message unsubscribe functionality
    This is a common scenario when integrating Twilio SMS with Customer Insights – Journeys (formerly Dynamics 365 Marketing). You're observing the default behaviour of Twilio, which can interfere with your goal of centralized consent management within Customer Insights.
    Breaking it down:

    1) Is Customer Insights – Journeys supposed to take over unsubscribe from Twilio?
    No, by default, Twilio handles opt-out keywords like STOP, UNSUBSCRIBE, etc., on its own servers, not within your Customer Insights environment. This means:
    • Twilio will auto-reply with its default opt-out confirmation.
    • The contact point consent in Customer Insights – Journeys is not updated unless you explicitly handle it.
    So, Customer Insights does not take over unsubscribe automatically — you need to build custom logic to bridge this gap.

    2) Do we need to build a trigger to update Contact Point Consent?
    Yes, if you want unsubscribes to be reflected in CI – Journeys, you’ll need to:
     A) Set up a Webhook or Twilio Function
    Configure Twilio to send incoming messages (like STOP) to a custom endpoint (Azure Function, Power Automate, or API).
    B) Parse the Incoming Message
    Check if the message contains STOP or other opt-out keywords.
    C) Update the Contact Point Consent record
    Use the Dataverse Web API, Power Automate, or a plugin to:
    • Locate the contact based on phone number.
    • Update the Contact Point Consent record to reflect Opt-Out for SMS.

    Suggested Flow Overview
    1. Twilio receives STOP.
    2. Twilio webhook hits your Azure Function / Power Automate flow.
    3. You parse the message and sender.
    4. You query Dataverse (Contacts) to find the match.
    5. You update the contact's consent for SMS in Contact Point Consent table.

    Twilio Webhook Docs
    Customer Insights – Journeys Consent Management
    Twilio Advanced Opt-Out Handling
     
  • Verified answer
    Daivat Vartak (v-9davar) Profile Picture
    7,835 Super User 2025 Season 2 on at
    SMS message unsubscribe functionality
    Hello Edgar@LCI,
     

    You've hit a key point in managing SMS consent with Customer Insights - Journeys (CIJ) and Twilio. Here's a breakdown of how it's supposed to work and the steps you need to take:

    1) Is Customer Insights Journeys supposed to take over the unsubscribe functionality from Twilio?

    Yes, ideally, Customer Insights - Journeys should manage the consent and unsubscribe status within its own system. While Twilio handles the technical delivery of the SMS and can manage its own opt-out lists, relying solely on Twilio's mechanism creates data silos and prevents you from having a unified view of customer consent within CIJ.

    The goal should be to:

    • Capture the unsubscribe request within CIJ.

    • Update the relevant Contact Point Consent record in CIJ.

    • Potentially instruct Twilio (via CIJ or other means) to stop sending commercial messages to that number.

    •  

    2) Once someone replies STOP to our commercial message are we supposed to build a custom trigger to update the contact point consent record?

    Yes, you will need to build a mechanism to capture the "STOP" reply and update the Contact Point Consent record in Customer Insights - Journeys. Here's how you'll typically approach this:

    The Recommended Workflow:


    1. Twilio Configuration (Webhook): You need to configure your Twilio phone number to send incoming messages (replies like "STOP") to a specific endpoint that Customer Insights - Journeys can understand. This is usually done by setting up a Webhook URL in your Twilio phone number settings.

    2. Customer Insights - Journeys Custom Trigger: You will create a custom trigger within Customer Insights - Journeys that listens for the specific data sent by Twilio when a "STOP" message is received. This data will typically include:

      • The phone number that sent the "STOP" message.

      • The content of the message ("STOP").

      • Potentially other metadata from Twilio. 

    3. Journey Logic (Branching): You've already done this part correctly by creating a branch in your journey based on the reply. This branch should be triggered when your custom trigger fires with the "STOP" keyword.

    4. Update Contact Point Consent: Within the "STOP" branch of your journey, you will add a step to update the Contact Point Consent record for the receiving phone number and the "Commercial" purpose. You will set the consent status to "Do Not Allow."

    5. (Optional but Recommended) Update Twilio Opt-Out: While CIJ should be your system of record for consent, it's often wise to also update Twilio's opt-out list to prevent accidental sending if there's a delay in CIJ processing or for compliance reasons. This can be done in a few ways:

      • Twilio Integration within CIJ (if available): Check if CIJ has built-in actions or connectors to directly interact with Twilio's suppression lists.

      • Power Automate: You could use a Power Automate flow triggered by the CIJ journey (after updating the Contact Point Consent) to call the Twilio API and add the phone number to an opt-out list in Twilio.


      •  

    6.  

    Detailed Steps:

    • Twilio Webhook Setup:

      • Log in to your Twilio account.

      • Navigate to your phone number's settings.

      • Find the "Messaging" section and look for "A message comes in."

      • In the "Webhook URL" field, you will need to enter the URL of a service that can receive the Twilio data and trigger your CIJ custom trigger. Directly pointing this to CIJ might not be possible. You might need an intermediary service like:

        • Azure Logic Apps or Functions: These can receive the Twilio webhook and then use the Dynamics 365 connector to trigger your custom trigger in CIJ.

        • Power Automate: Similar to Azure Logic Apps, Power Automate can receive the webhook and trigger CIJ.

        • A custom-built API: You could build your own API endpoint to handle the Twilio webhook and interact with CIJ. 
         

    • Customer Insights - Journeys Custom Trigger:

      • Go to Customer Insights - Journeys > Channels > SMS > Custom Triggers.

      • Create a new custom trigger.

      • Define the attributes that will be sent by Twilio (e.g., FromPhoneNumber, Body).

      • The logic in your intermediary service (Azure Logic App, Power Automate, etc.) will need to map the incoming Twilio data to the attributes of this custom trigger. 

    • Journey Configuration:

      • In your SMS journey, after sending a commercial message, add a "Wait for a trigger" tile.

      • Select the custom trigger you created.

      • Create a branch based on the Body attribute of the trigger being equal to "STOP" (case-insensitive). 

    • Update Contact Point Consent in Journey:

      • In the "STOP" branch, add an "Update contact or lead" tile.

      • Select "Contact Point Consent" as the entity.

      • Use the "Profile" relationship to link to the Contact associated with the phone number.

      • Set the consent for the "Commercial" purpose and the relevant SMS channel to "Do Not Allow." You might need to create a specific Contact Point Consent record if one doesn't exist for this phone number and purpose.


      •  

    •  

    In summary:


    1. Twilio sends "STOP" replies to an intermediary service (Webhook).

    2. The intermediary service triggers a custom trigger in Customer Insights - Journeys, passing the relevant data (phone number, message body).

    3. Your journey listens for this custom trigger and branches if the message is "STOP".

    4. The "STOP" branch updates the Contact Point Consent record in CIJ to "Do Not Allow" for the commercial purpose and SMS channel.

    5. (Optional) You can further automate updating Twilio's opt-out list via Power Automate or a direct integration.


    6.  

    This approach ensures that your consent data is managed within Customer Insights - Journeys, giving you a holistic view of your customer preferences and enabling you to comply with regulations. Remember to thoroughly test this entire flow.

     
    If my answer was helpful, please click Like, and if it solved your problem, please mark it as verified to help other community members find more. If you have further questions, please feel free to contact me.
     
    My response was crafted with AI assistance and tailored to provide detailed and actionable guidance for your Microsoft Dynamics 365 query.
     
    Regards,
    Daivat Vartak

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
Tom_Gioielli Profile Picture

Tom_Gioielli 117 Super User 2025 Season 2

#2
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 115

#3
Erin Lubben Profile Picture

Erin Lubben 66

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans