This repo is an example of sending one, a few and many SMS messages using the Twilio API.
You can read about how this code all works in the Ultimate guide to sending bulk SMS with Twilio and Node.js.
Clone the repo, then change into the directory:
git clone https://github.com/philnash/bulk-sms-alerts.git
cd bulk-sms-alertsInstall the dependencies:
npm installCopy the .env.example file to .env:
cp .env.example .envFill in the environment variables in .env. You will need to collect them from your Twilio console.
To run the different scripts, use the npm script. You can run:
npm run firstscoopto use the messaging API and a Twilio number to send one message.
Run:
npm run multipackto use the messaging API and a Messaging Service with Copilot to send multiple messages.
Run
npm run 99flaketo use the Notify API to send multiple messages with just one API call.