Skip to content

This is a php library to help developers include sms service, with FDI SMS gateway from RWANDA.

License

Notifications You must be signed in to change notification settings

aimedidierm/fdi-sms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aimedidierm/fdisms

This is a php library to help developers include sms service, with FDI sms gateway from Rwanda.

Installation

Install this package as a dependency using Composer.

composer require aimedidierm/fdisms

Usage

This is the documantion

<?php

require_once __DIR__ . '/../vendor/autoload.php';

use Aimedidierm\FdiSms\SendSms;

$to = ""; // Receiver phone number
$message = "";  // Text message to be send
$senderId = ""; // Your User ID provided by FDI
$ref = "";  // Your unique message reference ID
$callbackUrl = "";  //Optional Delivery Report destination

try {
$apiUsername = "";  // Your API Username provided by FDI
$apiPassword = "";  // Your API Password provided by FDI
$smsSender = new SendSms($apiUsername, $apiPassword);

$response = $smsSender->sendSms($to, $message, $senderId, $ref, $callbackUrl);

if ($response['success']) {
return response()->json(['message' => 'SMS sent successfully']);
} else {
return response()->json(['message' => $response['message'], 500]);
}
} catch (\Exception $e) {
return response()->json(['message' => $e->getMessage()], 500);
}

NB: For some people who are not using composer remember to add:

include_once("../vendor/autoload.php");

Contributing

Contributions are welcome! Before contributing to this project, familiarize yourself with CONTRIBUTING.md.

To develop this project, you will need PHP 8.1 or greater, Composer,

After cloning this repository locally, execute the following commands:

cd /path/to/repository
composer install

Now, you are ready to develop!

Copyright and License

The aimedidierm/fdisms library is free and unencumbered software released into the public domain. Please see MITLICENCE for more information.

About

This is a php library to help developers include sms service, with FDI SMS gateway from RWANDA.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages