If you send your marketing or transaction SMS directly in the same thread as the HTTP response to the client (e.g. the user clicks on "Register", the server makes a synchronous call [SMS API](/fr/api-sms-maroc/) and then returns the web page), your architecture is vulnerable.
If the Moroccan SMS Pass (IAM, Orange, inwi) takes 3 seconds to answer due to a network overload, the user will wait 3 seconds in front of a white screen. Worse, if the API is temporarily offline, your script will land, the user will see a 500 error page, and the SMS will be permanently lost.
For robust production, sending SMS must always be asynchronous via a Redis-managed waiting file. Here’s how to implement this resilience in the PHP and Node.js ecosystem.



