composer require sem-soft/yii2-smsru
Or add this code into require section of your composer.json and then call composer update in console
"sem-soft/yii2-smsru": "*"
In configuration file do
return[
...
'components' => [
...
'sms' => [
'class' => 'sem\smsru\Sms',
'api_id'=> '<api_code_hash>',
'oneSmsCost'=> 0.94
],
...
],
...
];
In code use example
$smsResponse = Yii::$app->sms->send("8903XXXXXXX", "Hello, Guy!");