PHP SDK for Dhiraagu Bulk SMS Gateway
You can install dhiraagu-sms via composer or by downloading the source.
Via Composer:
composer require dash8x/dhiraagu-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;
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;
A demo implementation of this package can be found here.
- Arushad Ahmed (@dash8x)
- Extended from tallminds/dhisms
This package is not in any way officially affiliated with Dhiraagu. The "Dhiraagu" name has been used under fair use.
This Dhiraagu Bulk SMS Gateway SDK is open-sourced software licensed under the MIT license