marqu3s/yii2-nrsgateway

Yii2 NRSGateway extension.

dev-master 2016-08-01 00:00 UTC

This package is auto-updated.

Last update: 2024-10-19 06:42:33 UTC


README

Yii2 Framework website

Installation

Composer

The preferred way to install this extension is through Composer.

Either run

php composer.phar require marqu3s/yii2-nrsgateway "dev"

or add

"marqu3s/yii2-nrsgateway": "dev"

to the require section of your composer.json

Usage

Add to main.php components section:

[
    'components' => [
        ...
        'sms' => [
            'class' => 'marqu3s\nrsgateway\YiiSMSService',
            'username' => 'theUsername',
            'password' => 'thePassword'
        ],
        ...
    ]
]

and use it:

$nrs = Yii::$app->sms->nrs;
$nrs->to   = ['xxxxxxxxxxxxx', 'yyyyyyyyyyyyy'];
$nrs->from = 'Sender';
$nrs->msg  = 'This is a test message.';
$result = $nrs->send();

Check $result variable for errors.

Original Author

João Marques, e-mail: joao@jjmf.com