๐Ÿ“ฆ anlutro / php-bulk-sms

BulkSMS API - PHP implementation

โ˜… 37 stars โ‘‚ 25 forks ๐Ÿ‘ 37 watching โš–๏ธ MIT License
๐Ÿ“ฅ Clone https://github.com/anlutro/php-bulk-sms.git
HTTPS git clone https://github.com/anlutro/php-bulk-sms.git
SSH git clone git@github.com:anlutro/php-bulk-sms.git
CLI gh repo clone anlutro/php-bulk-sms
Andreas Lutro Andreas Lutro capitalise readme 35c1ce0 10 years ago ๐Ÿ“ History
๐Ÿ“‚ 35c1ce08c0b9f1530c0b05b3ed9265c84e2ff2a3 View all commits โ†’
๐Ÿ“ src
๐Ÿ“ tests
๐Ÿ“„ .gitignore
๐Ÿ“„ .travis.yml
๐Ÿ“„ composer.json
๐Ÿ“„ LICENSE
๐Ÿ“„ phpunit.xml
๐Ÿ“„ README.md
๐Ÿ“„ README.md

BulkSMS API - PHP implementation

A simple implementation of BulkSMS for PHP.

Includes functionality to send single or batch messages.

Installation

This package requires PHP 5.4 because I'm too lazy to type array(). Sorry.

Using composer: composer require anlutro/bulk-sms - list of versions is available through GitHub's tag list.

Laravel 4

The package includes files to make usage super easy in Laravel 4.

  • Add anlutro\BulkSms\Laravel\BulkSmsServiceProvider to the list of providers in app/config/app.php.
  • Run php artisan config:publish anlutro/bulk-sms. Edit the config file in app/config/packages/anlutro/bulk-sms and fill in your username and password.
  • (optional) Add an alias for the facade by adding 'BulkSms' => 'anlutro\BulkSms\Laravel\BulkSms' to aliases in app/config/app.php.

Usage

Send Single Message

$bulkSms = new anlutro\BulkSms\BulkSmsService('username', 'password', 'baseurl');
$bulkSms->sendMessage('12345678', 'Hello there!');

Send Bulk Message

$message1 = new \anlutro\BulkSms\Message("12345678", "Hi there");
$message2 = new \anlutro\BulkSms\Message("12345678", "Hello again");
$bulkSms = new anlutro\BulkSms\BulkSmsService('username', 'password', 'baseurl');
$bulkSms->sendMessage(array($message1,$message2));

Get Status report

$bulkSms = new anlutro\BulkSms\BulkSmsService('username', 'password', 'baseurl');
$bulkSms->getStatusForBatchId(693099785);

In Laravel 4, you don't need to construct $bulkSms, and you can replace $bulkSms-> with BulkSms:: provided you followed the installation steps above.

Contact

Open an issue on GitHub if you have any problems or suggestions.

If you have any questions or want to have a chat, look for anlutro @ chat.freenode.net.

License

The contents of this repository is released under the MIT license.