📜 ⬆️ ⬇️

The yii extension for working with the sms.ru service

Today I would like to share information about the component for yii, which allows you to send SMS through the sms.ru service.

Installation:


Download yii-sms from the github repository - github.com/pimax/yii-sms :

cd protected/extensions git clone git://github.com/pimax/yii-sms.git 


In protected / config / main.php, add the following lines:
')
 'components' => array ( 'sms' => array ( 'class' => 'application.extensions.yii-sms.Sms', 'login' => 'username', //    sms.ru 'password' => 'password', //  ) ); 


Using:


Sending sms

 Yii::app()->sms->send('79251234567', ' '); Yii::app()->sms->send('79251234567', ' ', ' ', time(), $test=true, $partner_id); 

SMS status:

 Yii::app()->sms->status('sms id'); 

SMS cost:

 Yii::app()->sms->cost('79251234567', ' '); 

Balance:

 Yii::app()->sms->balance(); 

Daily limit:

 Yii::app()->sms->limit(); 

Senders:

 Yii::app()->sms->senders(); 

Check the validity of the login and password:

 Yii::app()->sms->check(); 

That's all!

Source: https://habr.com/ru/post/187360/


All Articles