An extension used to send sms messages using brazilian carriers.
The preferred way to install this extension is through composer.
Either run
$ composer require code-on-yii/yii2-sms:*
or add
"code-on-yii/yii2-sms": "*"
to the require
section of your composer.json
file.
You can use this extension in two ways.
Within app config
Append the carrier class, username and password in your config file:
'components' => [
'sms' => [
'class' => 'codeonyii\sms\twwwireless\SmsAdapter',
'username' => 'myusername',
'password' => 'mypassword',
]
]
Then you'll load the extension like this:
$sms = Yii::$app->sms;
Using the carrier adapter's class directly
Create the object intance, then initialize It with the username and password.
use codeonyii\sms\twwwireless\SmsAdapter;
$sms = SmsAdapter();
$sms->init('myusername','mypassword');
Sending messages
$sms->sendSms('554799999999','My Message');
Getting available credit
$sms->getCredit();
TODO