myzero1/yii2-smser

Yii2 SMS extension

Installs: 36

Dependents: 3

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 35

Type:yii2-extension

v1.5.2 2019-10-31 16:17 UTC

This package is not auto-updated.

Last update: 2024-10-26 03:10:20 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License

Yii2 SMS extension (短信扩展)

包含接口:

Installation

The preferred way to install this extension is through composer. Check the composer.json for this extension's requirements and dependencies.

To install, either run

$ php composer.phar require myzero1/yii2-smser "*"

or add

"myzero1/yii2-smser": "*"

to the require section of your composer.json file.

Usage

return [
    'components' => [
        'smser' => [
            // 中国云信
            'class' => 'myzero1\smser\CloudSmser',
            'username' => 'username',
            'password' => 'password',
            'fileMode' => false
        ]
    ],
];
return [
    'components' => [
        'smser' => [
        'smser' => [
            // 腾讯云
            'class' => 'myzero1\smser\QcloudsmsSmser',
            'appid' => '1400280813', // appid
            'appkey' => '23e167badfc804d97d454e32e258b781', // 请替换成您的apikey
            'smsSign' => '玩索得',
            'expire' => '5',//分钟
        ],
        ]
    ],
];

OR

return [
    'components' => [
        'smser' => [
            // 云片网
            'class' => 'myzero1\smser\YunpianSmser',
            'apikey' => '9b11127a9701975c734b8aee81ee3526', // 请替换成您的apikey
            'fileMode' => false
        ]
    ],
];
Yii::$app->smser->send('15000000000', '短信内容');
// 发送模板短信
Yii::$app->smser->sendByTemplate('15000000000', ['123456'], 1);

License

yii2-smser is released under the BSD 3-Clause License. See the bundled LICENSE for details.