PHP code example of autoxloo / yii2-twilio

1. Go to this page and download the library: Download autoxloo/yii2-twilio library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

autoxloo / yii2-twilio example snippets


// ...
'components' => [
        // ...
        'twilioSms' => [
            'class' => \autoxloo\yii2\twilio\sms\TwilioSms::class,
            'sid' => 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',          // Your Account Sid from twilio.com/user/account
            'token' => 'your_auth_token',                           // Your Account Auth Token from twilio.com/user/account
        ],
],

\Yii::$app->twilioSms->sendSms(
    '+15558675309',                                         // the number you'd like to send the message to
    [
        TwilioSms::OPTION_FROM => '+15017250604',                           // A Twilio phone number you purchased at twilio.com/console
        TwilioSms::OPTION_BODY => 'Hey Jenny! Good luck on the bar exam!',  // the body of the text message you'd like to send
    ]
);

php composer.phar