Giter Site home page Giter Site logo

getmanzooronline / wp-twilio-core Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mohsinoffline/wp-twilio-core

0.0 2.0 0.0 2.13 MB

A simple plugin to add SMS capability to your website using the Twilio API. Allows developers to easily extend the settings page and built in functionality.

License: GNU General Public License v2.0

PHP 99.11% CSS 0.61% JavaScript 0.09% Dockerfile 0.01% Makefile 0.09% Shell 0.01% Python 0.09%

wp-twilio-core's Introduction

WP Twilio Core

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.

How does it work?

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:

  • Custom function to easily send SMS messages to any number (including international ones)
  • Functionality to directly send a text message to any permissible number from the plugin settings page
  • Hooks to add additional tabs on the plugin settings page to allow managing all SMS related settings from the same page
  • Basic logging capability to keep track of up to 100 entries
  • Mobile Phone User Field added to each profile (optional)
  • Shorten URLs using Bit.ly or Google URL Shortener API (optional)

twl_send_sms( $args )

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.

Example
$args = array( 
	'number_to' => '+13362522164',
	'message' => 'Hello Programmer!',
); 
twl_send_sms( $args );	

Extending the Settings page

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 );
Contributors
Feel free to send pull requests. They are always welcome!
Copyright
[WP Twilio Core](https://wpsms.io/) plugin created by [WP SMS](https://wpsms.io). It is also available at the [WordPress Plugins repository](https://wordpress.org/plugins/wp-twilio-core/). For custom integration with your WordPress website, please [contact us here](https://wpsms.io/).

Disclaimer: This plugin is not affiliated with or supported by Twilio, Inc. All logos and trademarks are the property of their respective owners.

wp-twilio-core's People

Contributors

mohsinoffline avatar cparate43 avatar pbearne avatar

Watchers

Mansoorkhan T K avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.