A Yii2 extension to handle sending messages for most Nigerian bulksms http api connections
The preferred way to install this extension is through composer.
Either run
php composer require netesy/yii2-bulksms
or add
"netesy/yii2-bulksms": "*"
to the require section of your composer.json file.
Once the extension is installed, simply use it in your code by :
first add to config.php
<?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
<?php
Yii::$app->bulksms->sendMessage([
'number' => $number,
'message' => 'message',
]);
?>to send a call
<?php
Yii::$app->bulksms->sendCall([
'number' => $number,
'message' => 'message',
]);
?>to get your account balance
<?php
Yii::$app->bulksms->getBalance();
?>