, (*1)
A Yii2 extension to handle sending messages for most Nigerian bulksms http api connections
A Yii2 extension to handle sending messages for most Nigerian bulksms http api connections, (*2)
Installation
The preferred way to install this extension is through composer., (*3)
Either run, (*4)
php composer require netesy/yii2-bulksms
or add, (*5)
"netesy/yii2-bulksms": "*"
to the require section of your composer.json
file., (*6)
Supported websites
NigerianBulkSMS, (*7)
BetaSMS, (*8)
Usage
Once the extension is installed, simply use it in your code by :, (*9)
first add to config.php, (*10)
<?php
'components' => [
'bulksms' => [
'class' => 'netesy\bulksms\BulkSms',
'username' => 'xxxxxxxx',
'password' => 'xxxxxxxx',
'sender' => 'sender number',
'url' => 'the api address',
],
]
?>
Once the extension is installed, simply use it in your code by :
to send a message, (*11)
<?php
Yii::$app->bulksms->sendMessage([
'number' => $number,
'message' => 'message',
]);
?>
to send a call, (*12)
<?php
Yii::$app->bulksms->sendCall([
'number' => $number,
'message' => 'message',
]);
?>
to get your account balance, (*13)
<?php
Yii::$app->bulksms->getBalance();
?>