adisaf/vavasms-php-sdk
Composer 安装命令:
composer require adisaf/vavasms-php-sdk
包简介
Client library to send SMS using Vavasms SMS Gateway API (https://vavasms.com)
README 文档
README
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
Composer (recommended)
Install it via composer (https://getcomposer.org/).
- Run
composer require adisaf/vavasms-php-sdk - See script example https://github.com/adisaf/vavasms-php-sdk/tree/master/examples
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/tree/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!
统计信息
- 总下载量: 383
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-06-27