4

Most SMS providers allow you to respond with STOP to indicate that you no longer want to receive SMS messages. If we try to send another message to a phone number that has replied with STOP, it won't go out.

However, it's not clear how this information gets back to CiviCRM, if at all. Does this have to be handled on a per SMS provider basis? Or should we be building a more generic framework to support all SMS providers? Or is there a way I haven't figured out?

For reference - here's how Twilio handles it: https://support.twilio.com/hc/en-us/articles/223134027-Twilio-support-for-opt-out-keywords-SMS-STOP-filtering-

2 Answers 2

3

Used CiviRules to do this.

This switches the Do Not SMS flag to ON if they reply STOP: enter image description here

This switches the Do Not SMS flag to OFF if they reply START:

enter image description here

3
  • Very nice Guy! Slick. I used Activity details is an exact match to condition just in case a reply back contains stop and start and they aren't intending to opt in or out. It is case insensitive.
    – Andy Burns
    Commented Jul 30, 2021 at 23:59
  • Thanks Andy. I am surprised the Twilio extension doesn’t have this capability built in.
    – guyiac
    Commented Aug 1, 2021 at 13:46
  • The Twilio extension does have this capability built-in now.
    – guyiac
    Commented May 31, 2023 at 17:46
2

It's probably possible to do via an extension, e.g. something similar to https://civicrm.org/extensions/auto-reply-twilio-sms

Otherwise there is a generic "inbound" function that handles incoming sms if the provider lets you set up a callback, e.g. twilio setup, and it's implemented in civi via this code and individual sms provider extensions can use it like this.

So it seems possible to implement something generic.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.