marqu3s/yii2-nrsgateway

Yii2 NRSGateway extension.

Installs: 58

Dependents: 0

Suggesters: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:yii2-extension

dev-master 2016-08-01 00:00 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