integready/yii2-turbosms

Yii2 TurboSMS

Installs: 162

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 2

Forks: 14

Open Issues: 0

Type:yii2-extension

1.0.4 2017-10-26 11:46 UTC

This package is auto-updated.

Last update: 2024-03-29 03:07:01 UTC


README

Yii2 turbosms

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist integready/yii2-turbosms "*"

or add

"integready/yii2-turbosms": "*"

to the require section of your composer.json file.

Basic setup

You should have registered account at http://turbosms.ua/

Configuration

Add the following in your config:

<?php
...
    'components' => [
        'turbosms' => [
            'class' => 'integready\turbosms\Turbosms',
            'viewPath' => '@app/sms',
            'sender' => 'your_sender',
            'login' => 'your_login',
            'password' => 'your_password',
        ],
        ...
    ],
...

If you want test sms in debug mode change config:

<?php
...
    'components' => [
        'turbosms' => [
            'class' => 'integready\turbosms\Turbosms',
            'viewPath' => '@app/sms',
            'sender' => 'your_sender',
            'login' => 'your_login',
            'password' => 'your_password',
            'debug' => true,
        ],
        ...
    ],
...

in debug mode sms not send only add to db table.

Usage

Once the extension is installed, simply use it like a mailer in your code by :

 <?php 
    \Yii::$app->turbosms->compose('test-text', ['data' => $data])
        ->setTo('+380XXXXXXXXX')
        ->send();
 ?>

License

yii2-turbosms is released under the BSD 3-Clause License. See the bundled LICENSE.md for details.