This repository provides suitables tools for performing sms campaign. Actually, only Api's from MTN SMS CLOUD are embedded.
PHP 5.6.0 and later.
You can install the bindings via Composer. Run the following command:
composer require adjemin/mtnsmscloud
This repo has two main classes:
- BaseApi in
./src/MtnSmsCloud/BaseApi.php
- MTNSMSApi in
./src/MtnSmsCloud/MTNSMSApi.php
The first class is used to perform POST and GET HTTP request. The second one is used for MTN SMS.
Be sure to check the namespace first.
use MtnSmsCloud\MTNSMSApi;
/**
* Create a new Instance
*
* @param string $sender_id = The desired sender_id
* @param string $token = $token associated with $sender_id
*/
$msa = new MTNSMSApi($sender_id, $token);
/**
* Send a new Campaign
*
* @param array $recipients {Ex: ["225xxxxxxxx", "225xxxxxxxx"]}
* @param string $message
*/
return $msa->newCampaign($recipients, $message);
/**
* Retrieves on created Campaign
*
* @param string $campaign_id
* @param string $message
*/
return $msa->getCampaign($campaign_id, $message);
Made with ❤️ by Adjemin