WooCommerce Twilio SMS Notifications

Overview ↑ Back to top

Keep your customers happy by offering automated SMS order updates via Twilio. Send SMS updates to customers when their order status is updated and receive an SMS message when a customer places a new order. You can also manually send SMS messages through the “Edit Order” screen.

Installation ↑ Back to top

  1. Download the extension from your WooCommerce dashboard
  2. Go to Plugins > Add New > Upload and select the ZIP file you just downloaded
  3. Click Install Now, and then Activate
  4. Click the Configure link and read the next section to learn how to setup and configure the plugin.

Requirements ↑ Back to top

  • A Twilio account
  • PHP 5.3 or newer(You can see this under WooCommerce > Status)

Setup and Configuration ↑ Back to top

Connect your Twilio account ↑ Back to top

First, you’ll need your Twilio credentials to connect your store. Log into your Twilio Account, then click “View” next to “Auth token” on your dashboard. Copy the Account SID and Auth Token so you can enter these in the plugin settings.

WooCommerce Twilio: get API credentials

You’ll also need your “From” phone number for the plugin settings. If you don’t know this, you can access it by clicking “Phone Numbers” from the main menu.

WooCommerce Twilio Get "From" number
Get “From” number

Once you’ve copied these credentials, you can paste them into the plugin settings under WooCommerce > Settings > SMS in the “Connection Settings” section and save them.

WooCommerce Twilio connection settings

That’s it! You are now sending SMS updates! If you want to tweak settings and customize the SMS messages that are sent, continue reading.

Extension Settings ↑ Back to top

Now you can configure the plugin by going to WooCommerce > Settings > SMS.

General Settings

  • Opt-in Checkbox Label – The text for the opt-in checkbox on the checkout page.
    If you leave this field blank, the opt-in checkbox is disabled and ALL customers will receive SMS updates. Be very sure you want to do this.
  • Opt-in Checkbox Default – The default state for the opt-in checkbox on the checkout page. It’s recommended to leave this as un-checked.
  • Shorten URLs – Automatically shorten all URLs in SMS messages using the Google URL Shortener API.
  • Google API Key – (Shown if you enable shortening URLs) Google requires an API key to use their URL shortener. You can follow the instructions below to generate one for your site.

WooCommerce Twilio Settings 1

Admin Notifications

  • Enable new order SMS admin notifications – If enabled, SMS messages will be sent to the admin mobile number.
  • Admin Mobile Number – Enter the numbers to send new order notifications to. Include your country code if outside the US, but do not include spaces or dashes. Send notifications to multiple numbers by separating them with a comma.
  • Admin SMS Message – Customize the message that is sent to admins for new orders. You can include message variables (as listed below) to include additional information in this message.

Customer Notifications

  • Send SMS Notifications for these statuses – Check the statuses that you want SMS updates to be sent more. Note that SMS updates are sent when an order changes to these statuses. For example, an SMS update will be sent when an order changes from processing to completed if you check the “completed” checkbox.
  • Default Customer SMS Message – This is the default message template that’s used if there is not a customized template for a given status.
  • SMS Message – You can customize each status’s message template. For example, you could add a coupon code to the “completed” message template for 10% off the next order to help drive additional sales.

WooCommerce Twilio Settings 2

Return SMS Message

  • Enable return SMS message – Enable this to send customized return messages via Twilio when a customer replies to your automated SMS. See below for setup tips.
  • Response Message – Enter the custom response message to be sent (under 160 characters)

WooCommerce Twilio Return SMS / Sender ID settings

Sender ID Settings

  • Enable Sender ID – Enable this to use your company’s name as the sender ID for one-way messages. This is only supported for specific countries.
  • Sender ID – Enter your alphanumeric sender ID for messages.

Connection Settings

Follow the instructions above to get your Twilio credentials for this section.

  • Account SID – You’ll find this in your Twilio account.
  • Auth Token – You’ll find this in your Twilio account.
  • From Number – This is the number that Twilio will send your SMS messages from. You may enter any purchased number here (even a shortcode). Keep in mind that if you have not purchased Twilio Credit, you will only be able to send SMS messages to your verified sandbox number.
  • Log Errors – Log any errors to the PHP error log. Remember that errors with sending SMS messages for customers are logged as Order Notes regardless of this setting. For best performance, please only enable this if you experience issues with the plugin.

WooCommerce Twilio connection settings

Test Message

You can send a test message by entering a test number and message, then clicking “Send”. Note that if you’re using a trial account, the number you’re sending the test message too must already be verified in your account. Message variables will not be replaced in a test message since they have no data.

Google URL Shortener API key ↑ Back to top

If you want to enable URL shortening, you’ll need to follow these steps to generate an API key from Google, which you can enter in the plugin settings. This will replace all links to your site with shortened goo.gl URLs in SMS messages. To generate your key:

  1. Log into your Google account, then go to the developer console
  2. Click on “Create Project” from the “Projects” dropdown at the top.
    WooCommerce Twilio: Create Google Project
  3. Enter a name for your project, such as “Store Twilio URL Shortener”.
    WooCommerce Twilio: name google project
  4. Wait for the page to refresh while your project is being created. This may take a minute or two.
  5. Click on the URL Shortener API link under “Other Popular APIs” once you’re redirect to the “Library” section.
    WooCommerce Twilio add URL shortener API
  6. Click “Enable” at the top of the page.
    WooCommerce Twilio enable URL shortener
  7. You will now be directed to create credentials for your project. Click the “Go to credentials” button.
    WooCommerce Twilio generate credentials
  8. Skip the credentials set up by clicking the “API key” link to generate an API key.
    WooCommerce Twilio: generate API key
  9. This is not required, but when you name your key, we recommend limited use to only your site by entering http://yourstore.com/* (and https://yourstore.com/* if you have an SSL certificate) as an accepted referrer.
    WooCommerce Twilio: add accepted goo.gl referrers
  10. Click “Create” and copy your generated API key. You’ll need to paste this in the plugin settings, and URL shortening is now available.
    WooCommerce Twilio copy API key

Message Variables ↑ Back to top

Use the following variables to dynamically add order information to your SMS messages. These work for both customer and admin messages. See below if you want to add your own messages variables.

  • %shop_name% – The name of your site
  • %order_id% – the order ID
  • %order_count% – the number of orders the customer has placed
  • %order_amount% – the total amount of the order
  • %order_status% – the status of the order
  • %billing_name% – the customer name for the billing information
  • %billing_first% – the customer’s first name from the billing information
  • %billing_last% – the customer’s last name from the billing information
  • %shipping_name% – the name used in the order shipping information
  • %shipping_method% – the shipping method for the order

Return SMS Setup ↑ Back to top

When a customer replies to an SMS, Twilio will respond by default with a generic message that looks something like this:

Thanks for the message. Configure your number's SMS URL to change this message.Reply HELP for help.Reply STOP to unsubscribe.Msg&Data rates may apply.

You can instead create a customized response message by enabling the “Return SMS Message” setting and by enabling this in your Twilio account. To do so:

  1. Complete the “Return SMS” settings under WooCommerce > Settings > SMS
  2. Log into your Twilio account and navigate to the Phone Numbers page
  3. Select the phone number where you want to receive SMS
  4. Paste the URL from the plugin settings page into the Messaging > A message comes in field:
    WooCommerce Twilio Return SMS account settings

Bookings integration ↑ Back to top

WooCommerce Twilio can be used alongside WooCommerce Bookings to send booking appointment reminder and status update notifications. You must use WooCommerce Twilio version 1.12 or newer for this integration to appear.

When both Twilio and Bookings are active, you’ll see an additional settings section under WooCommerce > Settings > SMS for Bookings:

WooCommerce Twilio Bookings settings

Here you can configure which bookings messages should be sent along with the message schedule and content.

Bookings message settings ↑ Back to top

  • Opt-in checkbox label – Change the opt-in label displayed at checkout if the cart contains a booking product. If not set, this will use the default checkbox label under SMS > General settings.
    WooCommerce Twilio Bookings checkout label

You can then configure messages. All messages accept booking merge fields, as well.

Admin booking notifications

  • Send admin reminder SMS – Enable to send admin users a reminder before a booking begins. You can enter a list of admin recipients when enabled.
  • Reminder recipient(s) – A comma-separated list of recipients for the admin booking reminder message.
  • Send reminder – Determines how long before a booking the admin reminder message should be sent.
  • Admin reminder message – Enter the text used for the admin booking reminder SMS message.
  • Send admin cancellation SMS – Enable to send admin users a notification when a booking is cancelled. You can enter a list of admin recipients when enabled.
  • Reminder recipient(s) – A comma-separated list of recipients for the admin booking cancellation message.
  • Admin cancellation message – Enter the text used for the admin cancellation notification SMS message.

Customer booking notifications

  • Send customer reminder SMS – Enable to send customers a reminder before a booking begins.
  • Send reminder – Determines how long before a booking the customer reminder message should be sent.
  • Customer reminder message – Enter the text used for the customer booking reminder SMS message.
  • Send customer follow up SMS – Enable to send customers a follow up after a booking is completed.
  • Send reminder – Determines how long after a booking the customer follow up message should be sent.
  • Customer follow up message – Enter the text used for the customer follow up SMS message.
  • Send customer cancellation SMS – Enable to send customers a cancellation notice when a booking is marked as cancelled.
  • Customer cancellation message – Enter the text used for the customer cancellation SMS notification.
  • Send customer confirmation SMS – Enable to send customers a notification when a booking is confirmed. (Moves to “confirmed” status)
  • Customer confirmation message – Enter the text used for the customer booking confirmed SMS notification.

Bookings merge fields ↑ Back to top

The following merge fields can be used within booking SMS messages.

  • {shop_name} – Enters the name of the site
  • {billing_name} – Inserts the full customer billing name
  • {booking_start_time} – Inserts the booking’s start time
  • {booking_end_time} – Inserts the booking’s end time
  • {booking_date} – Inserts the booking’s date (uses the site’s date format)
  • {person_count} – If the booking has a “persons” field, inserts the person count for the booking
  • {resource} – If the booking has a resource, inserts the selected resource for the booking

Bookable product settings ↑ Back to top

If desired, you can also customize booking messages for each bookable product. You may choose to use the default settings or override sending settings for the bookable product, including customizing the booking message:

WooCommerce Twilio Booking product messages

Troubleshooting ↑ Back to top

Having trouble? Follow these steps to make sure everything is setup correctly before posting a support request:

  1. Check that your Account SID and Auth Token are correct.
  2. Double-check that your Account SID and Auth Token are correct 😉
  3. Enable logging and look in your PHP error log for error messages to pinpoint the source of the problem.
  4. Remember that SMS messages aren’t 100% reliable and sometimes may get lost. Try sending yourself a test SMS to see if you are sending and receiving SMS messages correctly.
  5. If a test message is unsuccessful or error logs don’t indicate the problem’s source, please submit a help request that includes the error log information.

Frequently Asked Questions ↑ Back to top

Q: Can I use custom order statuses to send messages?
A: You can indeed! Please ensure that you’re running WooCommerce Twilio version 1.6.0 or newer.

Q: If a customer requests to delete personal data, will this plugin remove SMS preferences?
A: If a personal data erasure request is submitted, this plugin will remove the customer’s SMS opt in for any orders that are anonymized. You must be using WordPress 4.9.6 or newer and WooCommerce 3.4 or newer to use these tools.

For Developers ↑ Back to top

Please note that this section and samples are intended for developers, and we cannot help out with customizations like this as per our support policy.

Want to extend this plugin? Great! Here are few commonly-used filters to help you out:

apply_filters( 'wc_twilio_sms_shorten_url', $shortened_url, $url )

Filters the generated shortened URL

apply_filters( 'wc_twilio_sms_customer_sms_before_variable_replace', $message, $order )

Filters message content before merge tags being replaced

apply_filters( 'wc_twilio_sms_customer_sms_after_variable_replace', $message, $order )

Filters message content after merge tags being replaced

apply_filters( 'wc_twilio_sms_customer_phone', $order->billing_phone, $order )

Filters the “to” phone number used for the customer

Here’s an example of how to do variable replacement for the Tracking Information extension and the Sequential Order Numbers Pro extension.

Questions & Support ↑ Back to top

Have a question before you buy? Please fill out this pre-sales form.

Already purchased and need some assistance? Get in touch with support via the help desk.

WooCommerce - the most customizable eCommerce platform for building your online business.

Back to the top