WP Twilio core is a simple plugin to add SMS capability to your website using the Twilio API.
If you've ever wanted to add text messaging functionality to your website or app, Twilio is one of the best solutions on the market. They're reasonably priced and have an excellent API.
The plugin primarily allows a WordPress developer to extend its settings and functionality and integrate it into any type of site. For example, it can easily be extended to send a text message on virtually any WordPress action.
The plugin also includes functionality to directly send a text message to any permissible number from the plugin settings page. You can use it to SMS any of your users or just for testing purposes
Here's a list of what the plugin provides out of the box:
Sends a standard text message from your Twilio Number when arguments are passed in an array format. Description of each array key is given below.
Array Key | Type | Description |
---|---|---|
number_to | string | The mobile number that will be texted. Must be formatted as country code + 10-digit number (i.e. +13362522164). |
message | string | The message that will be sent to the recipient. |
number_from (optional) | string | Override the Twilio Number from settings. Must be associated with Account SID and Auth Token |
account_sid (optional) | string | Override the Twilio Account SID from settings. Must be associated with Twilio number and Auth Token. |
auth_token (optional) | string | Override the Auth Token from settings. Must be associated with Twilio number and Account SID. |
logging (optional) | integer (1 or 0) | Override the logging option set from the settings page. Requires the digit '1' to enable. |
url_shorten (optional) | integer (1 or 0) | Override the Goo.gl URL shortening option set from the settings page. Requires the digit '1' to enable. |
url_shorten_bitly (optional) | integer (1 or 0) | Override the Bit.ly URL shortening option set from the settings page. Requires the digit '1' to enable. |
Returns an array with response from Twilio's servers on success of a WP_Error object on failure.
$args = array(
'number_to' => '+13362522164',
'message' => 'Hello Programmer!',
);
twl_send_sms( $args );
It is very easy to add your own tab to the plugin settings page. Please see the example below:
// Registering a new tab name
function add_new_settings_tab( $tabs ) {
$tabs['my_shop'] = 'My Shop';
return $tabs;
}
add_filter( 'twl_settings_tabs', 'add_new_settings_tab' );
// Adding form to that new tab
function add_my_shop_tab_content( $tab, $page_url ) {
if( $tab != 'my_shop' ) {
return;
}
// Add my settings form here!
}
add_action( 'twl_display_tab', 'add_my_shop_tab_content', 10, 2 );
Feel free to send pull requests. They are always welcome!
WP Twilio Core plugin created by WP SMS. It is also available at the WordPress Plugins repository. For custom integration with your WordPress website, please contact us here.
Disclaimer: This plugin is not affiliated with or supported by Twilio, Inc. All logos and trademarks are the property of their respective owners.