avator/yii2-turbosms

Yii2 turbosms

Installs: 26 479

Dependents: 0

Suggesters: 0

Security: 0

Stars: 10

Watchers: 4

Forks: 14

Open Issues: 1

Type:yii2-extension

1.0.9 2018-03-15 10:34 UTC

This package is not auto-updated.

Last update: 2024-04-13 14:50:24 UTC


README

Yii2 send sms from Turbosms.ua by SOAP

Requirements

  • PHP >=5.4.0
  • Install and Enable extension=php_soap.dll in your php.ini file

Installation

The preferred way to install this extension is through composer.

Either run

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

or add

"avator/yii2-turbosms": "*"

to the require section of your composer.json file.

Subsequently, run

./yii migrate/up --migrationPath=@vendor/avator/yii2-turbosms/migrations

Basic setup

You should:

Configuration

Add the following in your config:

<?php
...
    'components' => [
        'turbosms' => [
            'class' => 'avator\turbosms\Turbosms',
            'sender' => 'your_sender',
            'login' => 'your_login',
            'password' => 'your_password',
        ],
        ...
    ],
...

If you want test sms in debug mode change config:

<?php
...
    'components' => [
        'turbosms' => [
            'class' => 'avator\turbosms\Turbosms',
            '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 in your code by :

 <?php Yii::$app->turbosms->send('test', '+380XXXXXXXXX'); ?>

TODO

  • Translate message
  • Save log to file

License

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