evans/yii2-ucpaas

ucpaas sms sdk for Yii2

Installs: 20

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

Type:yii2-extension

dev-master 2017-07-17 02:35 UTC

This package is not auto-updated.

Last update: 2024-06-09 00:36:32 UTC


README

Yii2 SMS extension (云之讯短信扩展)

项目需要,目前只封装了短信发送,其余的功能抽空添加上。

第一次提交代码到github,难免会有问题,请包涵,欢迎提出问题。

Installation

The preferred way to install this extension is through composer.

To install, either run

$ php composer.phar require evans/yii2-ucpaas "dev-master"

or add

"evans/yii2-ucpaas": "dev-master"

to the require section of your composer.json file.

Usage

return [
    'components' => [
        'tongzhi' =>[
            'class' => 'evans\ucpaas\SmsUcpaas',
            'accountsid' => '这里填写您的Account Sid',
            'token' => '这里填写您的Auth Token',
            'appId' => '这里请填写您的应用id',
            'templateId' => '填写短信模板id',
        ],
		
		'yanzhma' =>[
            'class' => 'evans\ucpaas\SmsUcpaas',
            'accountsid' => '这里填写您的Account Sid',
            'token' => '这里填写您的Auth Token',
            'appId' => '这里请填写您的应用id',
            'templateId' => '填写短信模板id',
        ],
    ],
];

支持多配置

调用方式:
$sms = Yii::$app->tongzhi;
$param = "Evans,123123,jiangsu,china";//短信发送内容,以逗号分隔,具体多少个参数取决于短信模板里面
var_dump($sms->sendSMS('15298745787',$param));//调用短信发送

License

yii2-ucpaas is released under the MIT License.