Yii2 Sms Aero
https://smsaero.ru/api/v1/
Integration of SMS-messages to yii2 application, (*1)
Installation
One
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
php composer.phar require --prefer-dist sersid/yii2-smsaero "dev-master"
or add, (*4)
"sersid/yii2-smsaero": "dev-master"
to the require section of your composer.json
file., (*5)
Two
$config = [
...
'components' => [
...
'sms' => [
'class' => 'sersid\smsaero\SmsAero',
'user' => 'username',
//'password' => '*****',
'api_key' => 'paste_your_api_key' // use api_key or password
'sender' => 'SMS Aero', // default sender
],
]
];
Three
Read the documentation
http://smsaero.ru/api/, (*6)
Usage
Once the extension is installed, simply use it in your code by :, (*7)
Send message
Yii::$app->sms->send('798765543210', 'Message'); //@see Send message method
Checking the status of the sent message
Yii::$app->sms->status(123456);
Balance
Yii::$app->sms->balance(); // ['balance' => '30.00']
Available senders
Yii::$app->sms->senders(); // ['INFORM', 'MY_SENDER', '...']
Request new signature
Yii::$app->sms->sign('new sender');