Reputation: 2373
When a new user signs up, we're going to give them a checkbox where they can Opt-IN or Opt-OUT of receiving SMS messages.
I can easily track this on my own by making sure our application doesn't send texts their way, but I'm wondering if it makes more sense for me to just add them as opted out on Twilio?
I'm still playing around with this idea, but regardless I'm not seeing any API endpoints (https://www.twilio.com/docs/api) for Opt-In or Opt-Out.
Questions:
Upvotes: 2
Views: 6997
Reputation: 73029
Twilio developer evangelist here.
There is no API for developers to opt users' phone numbers in or out of messages so you should maintain that opt out list yourself within your own application as you described at the start of your question.
Twilio does make it possible for users to completely opt out of messages from a number (or messaging service) using the industry standard opt out words (STOP, STOPALL, UNSUBSCRIBE, CANCEL, END, and QUIT). When a user sends one of those words on their own to your number then Twilio will cease sending messages to that person. You will receive the message as a webhook so you can watch for those keywords and update your application's opt out list too.
I recommend that if you want users to opt out of messages that you get them to do so as part of your system rather via the STOP mechanic. That way, to re-enable messages they can do so through your system and not have to send an opt in message (START, YES and UNSTOP) to open up to messages again.
Upvotes: 9