Skip to content

Laravel and PHP adapter for sending SMS using Movesms (Movetech Solutions Bulk SMS)

License

Notifications You must be signed in to change notification settings

savannabits/movesms

Repository files navigation

Laravel / PHP Movesms

Latest Version on Packagist GitHub code size in bytes Travis (.com) Build Scrutinizer code quality Scrutinizer build Total Downloads

The Laravel / PHP SDK for Movetech Solutions' Bulk SMS API (Movesms). See their Bulk SMS API for more details.

Installation

You can install the package via composer:

composer require savannabits/movesms

Usage

Required API Params:

  • username - Your account Username
  • api_key - Your API Key
  • sender - Your Sender ID
  • to - Your Recipients separated by commas
  • message - Your Text Message
  • msgtype - Type of the message (use 5 for plain sms)
  • dlr - Type of Delivery Report(use 0 for no delivery Report)

Send Bulk SMS:

$username = "YOUR MOVETECH USERNAME"; 
$senderId = "YOUR MOVETECH SENDER ID";
$apiKey = "YOUR MOVETECH API KEY";

$recipients = [" 254xxxxxx"]; //Array of recipient phone numbers in international format
$message = "Hello World! Here is my message.";

$res =  Savannabits\Movesms\Movesms::init($username,$apiKey, $senderId)
            ->to($recipients)
            ->message($message)
            ->send();
                        
// Returns a php object with the following format:
$res = [
    "success" => true, //boolean
    "message" => "Message Sent:1701" // Or the error in case success = false
];

Schedule SMS to send Later

$scheduleAt = '2021-04-24 14:04:00'; // Time in the format Y-m-d H:i:s
$res =  Savannabits\Movesms\Movesms::init($username,$apiKey, $senderId)
            ->to($recipients)
            ->message($message)
            ->sendLater($scheduleAt);

Check credit Balance

$res = Savannabits\Movesms\Movesms::checkBalance($apiKey);

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.