envoisms/envoisms-php

Official PHP SDK for EnvoiSMS.ma - SMS, WhatsApp & OTP API in Morocco

Maintainers

Package info

github.com/FraudShield1/envoisms-php

Homepage

pkg:composer/envoisms/envoisms-php

Transparency log

Statistics

Installs: 0

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

dev-main 2026-07-23 15:22 UTC

This package is auto-updated.

Last update: 2026-07-23 16:17:51 UTC


README

Official PHP SDK for EnvoiSMS.ma — SMS, WhatsApp & OTP API platform for Morocco.

For complete API documentation and integration guides, visit EnvoiSMS Documentation.

Installation

Install via Composer:

composer require envoisms/envoisms-php

Quick Start

<?php

require_once 'vendor/autoload.php';

use EnvoiSMS\Client;

$client = new Client(getenv('ENVOISMS_API_KEY'));

// Send SMS
$response = $client->send([
    'to' => '+212600000000',
    'message' => 'Votre code de vérification est 492018',
    'from' => 'MonBusiness',
]);

echo 'Message ID: ' . $response['id'];

OTP Verification

// 1. Send OTP
$otpResponse = $client->sendOtp([
    'to' => '+212600000000',
    'brand' => 'MonBusiness',
    'code_length' => 6,
    'expiry' => 600,
]);

$sessionId = $otpResponse['session_id'];

// 2. Check OTP Code
$verifyResult = $client->checkOtp($sessionId, '492018');

if (!empty($verifyResult['verified'])) {
    echo "OTP verified successfully!";
}

Documentation

Full API reference is available at https://envoisms.ma/fr/docs.

License

MIT