The twilio Package
The twilio
package provides some useful programmatic SMS and voice message capabilities via the Twilio Service.
Reference:
Installation
Install twilio
, if necessary:
Setup
For SMS capabilities, sign up for a Twilio account, click the link in a confirmation email to verify your account, then confirm a code sent to your phone to enable 2FA.
Then create a new project with "Programmable SMS" capabilities. And from the console, view that project's Account SID and Auth Token. Update the contents of the ".env" file to specify these values as Environment Variables called TWILIO_ACCOUNT_SID
and TWILIO_AUTH_TOKEN
, respectively.
You'll also need to obtain a Twilio phone number to send the messages from. After doing so, update the contents of the ".env" file to specify this value (including the plus sign at the beginning) as an environment variable called SENDER_SMS
.
Finally, set an environment variable called RECIPIENT_SMS
to specify the recipient's phone number (including the plus sign at the beginning).
Usage
Send yourself an SMS:
Last updated