Smart SMS Solutions is a PHP library for sending messages with the https://smartsmssolutions.com API
To get the latest version of this library, simply require it
$ composer require gbxnga/smart-sms-solutions
Or you could add this to your composer.json
file
"gbxnga/smart-sms-solutions": "1.0.*"
After which you will run composer install
or composer update
to download it and update the autoloader
- Sending a message to a single recipient
<?php
require '../vendor/autoload.php';
use Gbxnga\SmartSMSSolutions\SmartSMSSolutions;
$sms = new SmartSMSSolutions("<EMAIL>","<PASSWORD>");
$sender = "Sender Name here";
$recipient = "11 Digit Nigerian phone number here";
$message = "Your Message here";
echo $sms->getBalance();
echo $sms->sendMessage($sender,$recipient,$message);
- Sending message to multiple recipients
<?php
require '../vendor/autoload.php';
use Gbxnga\SmartSMSSolutions\SmartSMSSolutions;
$sms = new SmartSMSSolutions("<EMAIL>","<PASSWORD>");
$sender = "Sender Name here";
$recipients = [
"XXXXXXXXXXX",
"XXXXXXXXXXX"
];
$message = "Your Message here";
echo $sms->sendMessage($sender,$recipients,$message);
To run the tests: include your smartsmssolutions.com email and password in the class SmartSMSSolutionsTest
constants.
Then run vendor/bin/phpunit
. Make sure there is more than zero SMS units on the account.
<?php
class SmartSMSSolutionsTest extends TestCase
{
const SMART_SMS_SOLUTIONS_USERNAME = "<EMAIL>";
const SMART_SMS_SOLUTIONS_PASSWORD = "PASSWORD";
.
.
.
}
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
The MIT LICNESE. Please see License File form more information.