aimedidierm/fdisms

This is a PHP library to help developers include SMS service with FDI SMS gateway from Rwanda.

v1.0.1 2024-05-31 13:03 UTC

This package is auto-updated.

Last update: 2024-08-31 00:26:05 UTC


README

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.