Opt-Out Automation
  • 08 Dec 2023
  • 2 Minutes to read
  • Contributors
  • Dark
    Light

Opt-Out Automation

  • Dark
    Light

Article summary

Build in Flow

  1. From Setup, search and select Flows.
  2. Click New. Choose Record-Triggered.
  3. Start your process on the SMS object and when a record is created or edited. Click Save.




  • 4. Add custom conditions for direction = incoming, and contact or lead is not null.



5. Drag a Decision element onto the canvas. Label it "SMS Preference."




6. Label the first outcome "Opt Out." Change the conditions to Any Conditions is Met (OR). Populate resource as $Record > Message. Populate the opt-out keywords in the values.



7. Add another outcome and label it "Opt-In."



8. Choose Any Condition is Met (OR). Populate the resource as $Record > Message. Populate your opt-in keywords in the values. Click Done.



9. In the Manager tab, click New Resource. Select Variable as the Resource Type. Select Boolean as the Data Type.



10. Drag a new Assignment element onto the canvas. Label it “Assign SMS Preference Value as FALSE.” Populate the variable and assign it theboolean value of False.



11. Drag a new Assignment element onto the canvas. Label it “Assign SMS Preference Value as TRUE.” Populate the variable and assign it the boolean value of True.



12. Drag a Decision element onto the canvas. Label the decision “Which object?” Label the first outcome “Contact.” Populate $Record > Contact into the Resource field. Set the Operator to Is Null and the Value to False.



13. Create a second outcome. Label it “Lead.” Populate $Record > Lead into the Resource field. Set the Operator to Is Null and the Value to False. Click Done.



14. Drag an Update Record element onto the canvas. Label it “Update Lead.” Choose to specify conditions to identify records and set fields individually.



15. Choose Lead as the object. Populate the filter requirements as Id EQUALS $Record > Lead > Lead ID. Set the record values to have the Mogli Opt Out field equal to the value of the preference variable.

16. Drag an Update Record element onto the canvas. Label it Update Contact.” Choose to specify conditions to identify records and set fields individually.




17. Choose Contact as the object. Populate the filter requirements as Id EQUALS $Record > Contact > Contact ID. Set the record values to have the Mogli Opt Out field equal to the value of the preference variable.



18. Connect the nodes with each decision pointing to the appropriate next element. Note: If their preference is to opt out of SMS, then point that decision to the assignment element that updates their preference to TRUE. Save and Activate.

Let's Test the Automation:

  1. Create a test Contact or Lead for yourself (if you haven’t already).
  2. Be sure that your Mogli Number is correctly populated.
  3. Text in one of your specified Opt-Out keywords to one of your Gateways.
  4. The Mogli Opt-Out checkbox should be checked, and the Conversation View should be greyed out.
  5. Text in one of your specified Opt-In keywords to that same Gateway.
  6. The Mogli Opt-Out checkbox should be unchecked, and the Conversation View should be enabled.

ADMIN TIP: Depending upon the version of Mogli you’re running (4.2 and under), you may need to allow 5-10 minutes for the Mogli Opt-Out Automation to take effect. The Process will run at the rate of your batch process, which runs anywhere from 5-10 minutes. To see how often your batch process runs, go to Setup > Scheduled Jobs. To modify your batch process, go to the Setup MogliSMS tab, click unscheduled, enter "5", and click schedule.


Was this article helpful?