dash8x / dhiraagu-sms
PHP SDK for Dhiraagu Bulk SMS Gateway
Installs: 2 342
Dependents: 1
Suggesters: 0
Security: 0
Stars: 5
Watchers: 2
Forks: 3
Open Issues: 0
Requires
- php: >=7.0
Requires (Dev)
- phpunit/phpunit: ^6.0
README
PHP SDK for Dhiraagu Bulk SMS Gateway
Installation
You can install dhiraagu-sms via composer or by downloading the source.
Via Composer:
composer require dash8x/dhiraagu-sms
Quickstart
Send an SMS
// Send an SMS using Dhiraagu Bulk SMS Gateway and PHP <?php $username = "XXXXXXX"; // The username that you received from Dhiraagu (usually same as your SMS sender name) $password = "YYYYYY"; // Your Dhiraagu Bulk SMS Gateway password $url = 'https://bulksms.dhiraagu.com.mv/partners/xmlMessage.jsp'; // The Dhiraagu API endpoint. Leave blank to use the default URL. $client = new \Dash8x\DhiraaguSms\DhiraaguSms($username, $password, $url); $message = $client->send( '+9607777777', // Text this number, use an array to send to multiple numbers 'Hello World!' // Your message ); print $message->message_id;
Check SMS Delivery Status
To check the delivery status of an SMS, first you will need to obtain the message_key
and message_id
when you send the SMS.
// Check the delivery status of an SMS using Dhiraagu Bulk SMS Gateway and PHP <?php $username = "XXXXXXX"; // The username that you received from Dhiraagu (usually same as your SMS sender name) $password = "YYYYYY"; // Your Dhiraagu Bulk SMS Gateway password $client = new \Dash8x\DhiraaguSms\DhiraaguSms($username, $password); $message = $client->send( '+9607777777', // Text this number, use an array to send to multiple numbers 'Hello World!' // Your message ); $delivery = $client->delivery( $message->message_id, // Message id $message->message_key // Message key ); print $delivery->message_status_desc; // Check the status for a particular recipient $device = $delivery->getDevice('9607777777'); // Omit the + of the country code print $device->status_desc;
Demo
A demo implementation of this package can be found here.
Credits
- Arushad Ahmed (@dash8x)
- Extended from tallminds/dhisms
Disclaimer
This package is not in any way officially affiliated with Dhiraagu. The "Dhiraagu" name has been used under fair use.
License
This Dhiraagu Bulk SMS Gateway SDK is open-sourced software licensed under the MIT license