Skip to content

Latest commit

 

History

History
62 lines (43 loc) · 1.76 KB

readme.md

File metadata and controls

62 lines (43 loc) · 1.76 KB

MTN SMS CLOUD PHP

Latest Stable Version Total Downloads Latest Unstable Version License

This repository provides suitables tools for performing sms campaign. Actually, only Api's from MTN SMS CLOUD are embedded.

Requirements

PHP 5.6.0 and later.

Composer

You can install the bindings via Composer. Run the following command:

composer require adjemin/mtnsmscloud

Architecture

This repo has two main classes:

The first class is used to perform POST and GET HTTP request. The second one is used for MTN SMS.

Instanciation

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