How to send SMS messages with Twilio
Here's how to configure Twilio SMS for use with Knock.
We'll walk through a few steps to take in Twilio before jumping into how to configure Twilio within Knock.
Before you set up your Twilio SMS channel in Knock, you'll need to take the following steps in Twilio.
- Sign up for a Twilio account if you haven't already.
- Get your first SMS-enabled phone number in Twilio. You'll use this as the "from" phone number in your channel configuration within Knock. (We also support Twilio short codes and messaging services, but we won't be covering those in this guide.)
- If you're Twilio account is in trial mode, you'll need to pre-verify any phone numbers with Twilio that you plan to send to from Knock during testing.
Once you've completed those steps, you're ready to start sending SMS notifications with Knock.
You can follow the steps in our guide on adding a new channel to create your Twilio channel within Knock. Once the channel has been created, you'll need to configure each of your Knock environments to work with Twilio.
Each environment requires a Twilio account ID, an auth token, and a "from" resource within Twilio from which to send messages. This "from" resource can be a Twilio phone number, short code, or messaging service. (If you are using a phone number, keep in mind that all numbers used in Knock must be in E.164 format.)
Once you've configured your Knock environments with the correct Twilio credentials, you're all set to start using workflows with your new SMS channel. Remember that any recipients you want to notify via SMS will need a
phone_number sent to their user record in Knock.