Use the Twilio add-on to send an SMS/text message when a form is submitted or when an entry is updated. You may also allow users to text in their votes for a poll or survey created by Formidable Forms. Each received text message will automatically create a new entry in your form.

Download and Install
- If you haven't already, install and activate the current version of Formidable Forms Premium on your WordPress site.
- After confirming your Formidable Forms license, proceed to the Formidable → Add-Ons page and toggle on the Twilio SMS plugin for WordPress.
Set up Twilio SMS integration
Step 1: Get Twilio API keys
- After installation, log in to your Twilio account. Access your Twilio console by navigating to Account and selecting My First Twilio Account.
- Navigate to the Admin dropdown menu at the top of the page and select Account Management.
- In the left sidebar, navigate to Keys & Credentials → API keys → tokens.
- If you haven't created an API key yet, click Create API Key.
- Enter a name for your key, and choose Standard for the key type.
- In the API keys & tokens page, copy your Twilio Account SID and Secret Key. If you use a trial account, you must verify the number you are sending to.
- Go back to your site. Navigate to the Formidable → Global Settings → Twilio page and insert the API keys. The Account SID is the Twilio SID key, and the Auth Token is the Twilio Secret key.
Step 2: Set up Geo permissions
Twilio lets you send text messages to many countries worldwide. By setting up SMS Geo Permissions, you can choose which countries you want to send messages to. To protect against fraud, Twilio recommends turning off message sending to countries your business doesn't use or rarely uses.
When creating an account, you can automatically send messages to the country associated with the phone number you used during signup. Follow the instructions below on how to change the SMS Geo Permissions.
- Log in to your Twilio Account where you want to change the permissions.
- Navigate to Console → Messaging → Settings → Geo Permissions.
- Scroll through the list and find the country where you want to turn the SMS Geo permissions on or off. When you find the country, select the checkbox next to its name or use the Filter by Country search box.
- (Optional) If you send SMS to United States numbers, you must first register for A2P approval. You can start registration by navigating to Messaging → Regulatory Compliance → A2P 10DLC.
- Click the Save Geo permissions button to save your changes. Learn more about setting up SMS Geo permissions with Twilio.
Create a Twilio SMS form
You may send an SMS text message as an autoresponder when a Formidable form is submitted or when an entry has been updated. Make sure that you have set up your Twilio SMS integration before proceeding with the step-by-step guide below.
- Create a form for sending text messages. Include a Phone Number field in your form if you want to send the message to the user who is filling out the form.
- Go to form Settings → Actions & Notifications tab. Click on Twilio to add a Twilio action to your form.
- Give your Twilio form action an Action Name for easy reference. This action name will only be seen on the back end.
- Select one or more actions in the Trigger this action when dropdown. Different triggers will be visible depending on which add-ons are active. The User Registration add-on allows sending a text after a user successfully registers. The PayPal and Stripe forms add-ons allow text messages to be sent when a payment has been completed..
- Insert a phone number or the Phone Number field ID in the To box. You may insert multiple phone numbers separated by a comma. A separate text will be sent to each phone number.
- In the From box, you have the following options:
- All numbers in the linked Twilio account. Choose one of these for live sending. These numbers are cached in the dropdown for 15 minutes. Choose the number linked from the Twilio account if you need it cleared sooner.
- The Twilio Test number. A test number can only be sent to another test number.
- Use a different Twilio phone number. Don't add a custom number unless you know what you're doing. Be sure to include the international code.
- Use the [default-message] shortcode in the Message box when sending an SMS message. This will send a message like: Sent from your Twilio account. Your responses were successfully submitted. Thank you!
If you want to customize your own message, enter the message that you would like to send in the Message. Click on fields in the Customization panel to add field values from the entry into your message.
- To send a text message conditionally, you must add Conditional Logic. You can set it up such that it only sends a text message when a user agrees to receive it. Please note that Conditional Logic is only available in the premium version of Formidable Forms.
- Click Update. Now, when a user submits or updates an entry, a text message is sent to the specified recipient.
Phone Formatting
When setting up your Phone Number field format, Twilio recommends using E.164 number formatting for all To and From phone numbers to ensure deliverability. Learn more about Twilio Phone Number formatting.
The E.164 formatted phone numbers can be written as:
[+][country code][area code][subscriber number]
For example, this is the recommended format for a US phone number.
+14188884567
Set up text voting
Use Twilio to allow users to text responses to a poll or survey. The responses will be stored in your form's entries.
- Create a poll or survey with Formidable Forms. This form can have only one survey question. We also recommend including a text field to act as a catch-all for invalid votes.
- Log into your Twilio account and go to the Phone Numbers page.
- Find the phone number that you will be using to accept text votes. Click on the phone number so you can edit the messaging configuration.
- Select your preferred messaging service.
- Configure with Webhook, TwiML Bin, Function, Studio Flow, Proxy Service
- Select Webhook when a message comes in and HTTP POST as the HTTP. Change the Messaging URL to:
your-site-url/wp-admin/admin-ajax.php?action=frm_twilio_vote&form=5
Replace your-site-url with your own site's URL. Change 5 to the ID of your form.
- When the user texts their vote to your Twilio phone number, the text message content will be saved to your poll or survey form's entries. Your users can either text the number position of the choice in your form or the word itself. For example, if I have a poll for favorite colors and my choices are Red, Green, Pink, and Blue, and my favorite color is pink, then I can text any of the following:
- 3
- Pink
- pink
- PINK
Send texts to a phone number list
If you would like to send texts to a list of phone numbers that have been entered in a Formidable form, follow the steps below.
- Create a view that is connected to the form where phone numbers are stored. We'll call this the Numbers View. The View will need to be set up to display All Entries.
- In the Content box insert the ID of your phone number field. Click Update.
- Create a new form, this is the form that will be used to send out messages, call this your Send SMS Form form. Add any fields you would like to use and click Update
- Follow the steps here to create your Twilio action.
- In the To box, insert the shortcode for the Numbers View.
[display-frm-data id=x]
Replace [x] with the ID of the Numbers View.
- In the Message box, insert the message you would like to send upon submission. Use the customization panel to insert field values. Click Update
- Publish your Send SMS Form on a page. It is recommend to change the Visibility to Private or Password Protected so only specific users can send texts to the Phone Number list.
Click Update. - Now when you fill out the Send SMS Form form and hit submit, it will send out the message to all the phone numbers saved in the Numbers Form.
Filtering phone number list
If you would like to send text messages to a filtered phone number list, using a parameter is useful. For this example, you can send text messages to users that have more than a certain number of points in their account.
- Before proceeding, you will first need to create the Numbers View.
- Go to edit your View.
- Scroll down to the Advanced Settings. In the Sort & Filter section click the + Add button next to Filter Entries. Set up the filter so it says "Points is greater than [get param=points]"
- Click Update to save your View.
- When inserting the View shortcode, add a param with the value from the field.
[display-frm-data id=62 points="[100]"]
The value in field 100 will be sent to the View and used in the filter. Swap out 62 for the ID or key of your View.
Related customizations
Undo phone formatting
When a phone number is prepared in this plugin, it is forced to be numeric. But if you are using a Twilio alphanumeric phone number, you will need to reverse this automatic formatting.
add_filter( 'frmtwlo_format_number', 'format_twilio_num', 10, 2 ); function format_twilio_num( $num, $args ) { return $args['original']; }
Save phone number in a field
By default, the phone number is stored as the IP address for Twilio submissions. This example copies the value into another field.
add_filter( 'frm_validate_field_entry', 'copy_twilio_phone_number', 10, 3 ); function copy_twilio_phone_number( $errors, $posted_field, $posted_value ){ if ( $posted_field->id == 25 && isset( $_POST['ip'] ) ) { //change 25 to the ID of the phone field $_POST['item_meta'][$posted_field->id] = $_POST['ip']; } return $errors; }
Troubleshooting
No SMS message received
- Are you using a Twilio trial account? If so, did you verify the number you are sending to?
- Does the From number in your form settings match the number in your Twilio account? You must send from a Twilio number.
- If you are outside the USA, you must include an international code on the phone numbers. If these are missing, the USA code is used.
- SMS messages will not send if you are using test API credentials. The live credentials are required.
Twilio alphanumeric sender
At this time, sending from an alphanumeric id is not supported. Unfortunately, Twilio does not support this feature in the USA, so our developers are not able to test or support it.
Error messages
Sorry, there was an error saving your vote.
This message is shown in two cases.
- The form ID in your Twilio API URL isn't a valid form id.
- Your form is set to only allow logged in users to submit.
Sorry, you can only vote once.
This message is returned when your form is limited to one response per user, and this phone number already has a submission in this form.