adjemin/mtnsmscloud

That packages provides suitables classes for SMSCloud performing.

1.0.3 2020-06-26 02:28 UTC

This package is auto-updated.

Last update: 2024-11-27 00:56:20 UTC


README

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