Yii 2.0: labsmobilesms

Send SMS all over the world using LabsMobile platform and their HTTP/POST API.
2 followers

Send SMS with a single line of code. You can send SMS all over the world using LabsMobile platform and their HTTP/POST API.

Requirements

  • Yii 2.0

  • A LabsMobile user account. Go to www.labsmobile.com to signup.

Usage

  1. Copy the LabsMobileSMS folder into /vendor

  2. Add the following lines into you configuration file (ex. /config/web.php)

...
'components' => [
        ...
        'sms' => [
            'class' => 'app\vendor\LabsMobileSMS\LabsMobileSMS',
            'LMaccount_username'=>'{YOUR USERNAME}',
            'LMaccount_password'=>'{YOUR PASSWORD}',
            'LMaccount_clientapi'=>'{YOUR API CLIENT}',
        ],
  1. Now you can send SMS with the following code:
Yii::$app->sms->send(array('to'=>'14158141829', 'message'=>'Hello world!'));

or check the credits of your LabsMobile account:

Yii::$app->sms->get_balance();

Resources

Be the first person to leave a comment

Please to leave your comment.

Create extension