odinshat/yii-clickatell-smscomponent
Composer 安装命令:
composer require odinshat/yii-clickatell-smscomponent
包简介
Yii component for interfacing with the Clickatell SMS HTTP API
关键字:
README 文档
README
A component for the Yii framework using the Clickatell HTTP API.
Able to send single SMS or start a batch session and send batch text messages. See the Clickatell HTTP API documentation for further details on what this entails.
Installation
1. Copy SendSmsComponent.php
Copy the main SendSmsComponent.php file into your appfolder/components directory.
2. Complete Configuration
In your Yii config file under the components section be sure to add the following details within components as a seperate settings array called smsSend:
'components'=>array( 'smsSend'=>array( 'class' => 'application.components.SendSmsComponent', 'api_user' => 'API username', 'api_pass' => 'API password', 'api_from' => 'FromName', 'api_id' => 0000000 ), [...] ),
Usage
Sending a single text
$sms = Yii::app()->smsSend; $sms->postSms('070000000', "Some message", "SenderName");
Getting query coverage for a phone number
$sms = Yii::app()->smsSend; if($sms->queryCoverage(070000000)){ echo 'Can send'; }
Sending batch messages
To follow. It is possible to do if you can work with the source to figure it yourself until I can extract an example from our exiting system.
Further Information
- Yii PHP Framework
- Yii Extension Site Page
- Clickatell HTTP API documentation (pdf)
- This component was originally adapted from a CakePHP component I made in 2008 available here (not maintained).
统计信息
- 总下载量: 13
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD
- 更新时间: 2014-04-25