2amigos/yii2-nexmo-library
最新稳定版本:1.0.1
Composer 安装命令:
composer require 2amigos/yii2-nexmo-library
包简介
The Nexmo library for the Yii framework
README 文档
README
Nexmo Library allows Yii programmers to use the Restful API offered by Mobile Messaging provider Nexmo.
Nexmo is a cloud-based SMS API that lets you send and receive high volume of messages at wholesale rates.
Installation
The preferred way to install this extension is through composer.
Either run
$ composer require 2amigos/yii2-nexmo-library:~1.0
or add
"2amigos/yii2-nexmo-library": "~1.0"
to the require section of your composer.json file.
Usage
First you have to create your [Nexmo account](Nexmo API credentials) and get your API_KEY and API_SECRET.
// to send an sms message $sms = new \dosamigos\nexmo\Sms(['key' => 'API_KEY', 'secret' => 'API_SECRET', 'from' => 'SENDERID']); // lets call the API to get a json response $sms->format = 'json'; // send a message with an optional parameter (see Nexmo doc for more optional parameters) $response = $sms->sendText('RECIPIENTSNUMBER', 'Hello World!', ['clientRef' => 'YOURCLIENTREF']); // if a response expects a JSON object, it will return as an array, if format was a XML, it will return an object. echo $response['message-count']; // the number of parts the message was split into
Testing
$ ./vendor/bin/phpunit
Contributing
Please see CONTRIBUTING for details.
Credits
License
The BSD License (BSD). Please see License File for more information.
web development has never been so fun
www.2amigos.us
统计信息
- 总下载量: 5.69k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2014-05-25