Yii 1.1: twiliosms

Send SMS - messages all over the world using twilio
13 followers

Send SMS - messages all over the world using twilio

Note: Single class file only for sending sms - messages. Other twilio features are not included.

Requirements

Yii 1.1 or above

PHP 5 above

Usage

Copy the twiliosms folder into protected/extensions/

require_once('/path/to/extensions/twilio/Services/Twilio.php');
 
$sid = "{{ ACCOUNT SID }}"; // Your Account SID from www.twilio.com/user/account
$token = "{{  AUTH TOKEN }}"; // Your Auth Token from www.twilio.com/user/account
 
$client = new Services_Twilio($sid, $token);
$message = $client->account->sms_messages->create(
  '+14158141829', // From a valid Twilio number
  '+14159352345', // Text this number
  "Hello world! This is admin, testing our twilio api"
);

Resources

Total 8 comments

#18598 report it
Rajith R at 2014/11/26 06:06am
@kapous

find and replace preg_replace(): with preg_replace_callback . its about new php version.

#18578 report it
kapous at 2014/11/20 11:53am
Error ... need update

i got this error when run

preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead

#18210 report it
Quaro at 2014/09/26 07:03pm
Requirements?

Is there anything else other than php 5 I need to run this? Cause it works on xampp but not when I uploaded it to my host server

#17627 report it
Rajith R at 2014/07/09 01:43am
@Rohit Suthar

Thank you.

#17613 report it
Rohit Suthar at 2014/07/08 04:46am
Nice

Thank you very much for your patience and sharing your knowledge..

#16358 report it
Rajith R at 2014/02/14 06:58am
@Nisanth thulasi

Thank you.

#16335 report it
Nisanth thulasi at 2014/02/12 01:10am
Good work

Good work!

#13727 report it
Rajith R at 2013/06/20 02:49am
Example
require_once(dirname(__FILE__) . '/../extensions/twilio/Services/Twilio.php');
 
                    $sid = ""; // Your Account SID from www.twilio.com/user/account
                    $token = ""; // Your Auth Token from www.twilio.com/user/account
 
                    $client = new Services_Twilio($sid, $token);
                    try {
                    $message = $client->account->sms_messages->create(
                      '44444444444', // From a valid Twilio number
                      $to, // Text this number
                      $textmessage //message
                    );
                    $twilioMessageResponse = $message->sid; 
                    $receiver_count++;  
                    }
                                        catch (Exception $e) {
                        $error[$receiver_count] = $e->getMessage();

Leave a comment

Please to leave your comment.

Create extension
Downloads