In Morocco, due to the cost of [Interactive Shortcodes bidirectional] (/fr/blog/numeros-longs-courts-or-virtuels-pour-l-envoi-sms-au-maroc/), the method of "Response STOP to this message" (which is the standard in the United States or France) is sometimes complex to set up for SMEs that use an Alphanumérique Sender ID (which does not allow answers).
Here are the two compliance methods preferred by using the EnvoiSMS API:
1. The Dedicated Cancellation Number (Local Longcode): You add at the end of your SMS (ideally in a new segment or managing the 160-character space) a local virtual number to which the customer can send a "STOP" SMS. >"Special Offer: -20% on the store today. (To unsubscribe, send STOP to 06XX XX XX.)" Your server listens to this number via a webhook.
2. The HTTP (Modern Approach) Opt-Out Link: Instead of asking the customer to send a SMS, you include a short link (URL Shortener) redirecting to a minimalist web page. > "Discover the new winter collection in store. STOP SMS: bit.ly/opt-out-brand" The customer clicks, arrives on a page containing a single "I confirm my opt-out" button, and the link is directly linked to the customer ID in your database.