Uses the Twilio API to send SMS messages in bulk
- Run
composer install
- Rename the
config-sample
directory toconfig
- In
auth.txt
, enter youraccount_id
andauth_token
from Account Settings as well as yoursent_from
number from Phone Numbers- The default
sent_from
number is a Twilio test number that will appear to send successfully but won't actually send any messages
- The default
- In
cost.txt
, set thecost
per SMS send, currencysymbol
and the exchangerate
from USD to your local currency- This step is not necessary but is used to project the amount you will be charged
- Example pricing and exchange rates are accurate at the time of writing but may require updating in future
- See Twilio's Pricing
- In
message.txt
, enter the content of the SMS message you wish to send- Your messages will cost you roughly 50% less if you only use characters from the GSM-7 Character Set
- in
recipients.txt
, enter the phone numbers of the intended recipients, one per line (including country code, without spaces or special characters, e.g.+441234567890
) - When ready to send, run
php twilio-bulk.php
from the command line- Your message will be shown first and any characters that aren't in the GSM-7 Character Set will be highlighted in red
- The presence of such characters will force UCS-2 encoding, which will reduce the number of characters that will fit in a single SMS and therefore will cost you more
- Read more about GSM-7