https://smsaero.ru/api/v1/ Integration of SMS-messages to yii2 application
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist sersid/yii2-smsaero "dev-master"
or add
"sersid/yii2-smsaero": "dev-master"
to the require section of your composer.json
file.
$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
],
]
];
Read the documentation http://smsaero.ru/api/
Once the extension is installed, simply use it in your code by :
Yii::$app->sms->send('798765543210', 'Message'); //@see Send message method
Yii::$app->sms->status(123456);
Yii::$app->sms->balance(); // ['balance' => '30.00']
Yii::$app->sms->senders(); // ['INFORM', 'MY_SENDER', '...']
Yii::$app->sms->sign('new sender');
Comments