This example shows how to setup simple opt-out verification.
git clone https://github.com/pBread/Simple-Opt-Out.git
cd simple-opt-out
3. Add the environment variables per .env.example
ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
AUTH_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
OPT_OUT_PHONE=+12223334444
go run .
ngrok http 8080
Initiate the verification process by going to http://localhost:8080/opt-out/new?to=+12223334444
, but replace the phone number with your personal phone number. You should receive an SMS message.
Reply to the text message with and w/out the keyword TESTER
to see what happens.
NOTE: This example does not unsubscribe you when you respond with the keyword. You need to update func unsubscribe with the necessary logic to disable the user/post in your database.