New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

adisaf/vavasms-php-sdk

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

adisaf/vavasms-php-sdk

Client library to send SMS using Vavasms SMS Gateway API (https://vavasms.com)

Source
Packagist
Version
v1.0.4
Version published
Total downloads
383
Maintainers
1
Created
Source

Vavasms PHP SMS API SDK

PHP client library to send SMS messages using Vavasms SMS Gateway.

To use this library, you must have a valid account on https://www.vavasms.com.

Please note SMS messages sent with this library will be deducted by your Vavasms account credits.

For any questions, please contact us at tech@vavasms.com

How to send a message

<?php
$vavasms_username = 'your_username'; // Please register on https://vavasms.com
$vavasms_password = 'your_password';
$sender = 'your_sender_id';
$recipients = '+22507070707';
$text = 'Hello World!';

$sms = new Adisaf\VavaSms\SMS();

try {
    $sms->setMessage($text)
        ->setSender($sender)
        ->setRecipients($recipients)
        ->authenticate($vavasms_username, $vavasms_password);
    $smsResult = $sms->send();
    if ($smsResult["message"] == "OPERATION_SUCCES") {
        $lotId = $smsResult["data"]["lot_id"];
        foreach ($smsResult["data"]["message_id"] as $i => $messageId) {
            echo "Message to {$recipients[$i]} has id {$messageId} <br>";
        }
    } else {
        echo "error : {$smsResult["message"]}";
    }
} catch (Exception $e) {
    var_dump($e->getMessage());
}

Installation

Install it via composer (https://getcomposer.org/).

Other autoloaders

This package is PSR-4 compliant, so you can clone the repository in your project and a use PSR-4 compatible autoloader (e.g. Symfony or Laravel)

Manual installation

You can simply clone the repository into your project and use the classes contained in src/ directory.

Please check the examples directory here: https://github.com/adisaf/vavasms-php-sdk/blob/master/examples/

More info

You can check out our website https://vavasms.com or contact us.

Contributing

If you wish to contribute to this project, please feel free to send us pull request. We'll be happy to check them out!

Keywords

http

FAQs

Package last updated on 25 Aug 2020

Related posts