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
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.
João Marques, e-mail: [email protected]