---
title: "Opt-Out"
description: "1 posts about Opt-Out, summarised, each linking to the original."
---

# Opt-Out
> 1 posts about Opt-Out, summarised, each linking to the original.

## Articles

### [How to Track Opt-Outs in PHP](https://yomu.fyi/post/how-to-track-opt-outs-in-php.md)
- Company: [Twilio](https://yomu.fyi/company/twilio.md)
- Author: Matthew Setter
- Published: Oct 2, 2026
- Type: Tutorial

This tutorial demonstrates building a PHP application that records customer opt-out preferences from SMS replies using Twilio’s Incoming Message Webhook and Event Streams, which require PHP 8.5, Composer, and SQLite. When the SMS body is an opt-out keyword such as STOP, START, or HELP, Twilio includes an OptOutType parameter in the webhook request, which the application checks using strcasecmp and array\_first. The application, based on the Twilio Slim Base project, stores the opt-out status and account SID in an SQLite database via PHP-DB and laminas-servicemanager, using a TableGateway for the user\_optouts table. The handleWebhook() function validates the OptOutType against class constants (OPT\_OUT\_TYPE\_START, OPT\_OUT\_TYPE\_STOP, OPT\_OUT\_TYPE\_HELP) and inserts a record before returning a TwiML response. Twilio already blocks further messages for standard opt-outs, but local recording enables advanced actions like syncing a CRM; the tutorial covers bootstrapping, configuring Twilio messaging services with Advanced Opt-Out, using ngrok, and verifying with an SQL query.
