Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/daixianceng/yii2-smser
Yii2 SMS extension
https://github.com/daixianceng/yii2-smser
yii2-sms-extension yii2-smser
Last synced: 18 days ago
JSON representation
Yii2 SMS extension
- Host: GitHub
- URL: https://github.com/daixianceng/yii2-smser
- Owner: daixianceng
- License: bsd-3-clause
- Created: 2015-05-26T04:18:16.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-02-11T15:03:19.000Z (almost 7 years ago)
- Last Synced: 2024-07-31T20:45:29.583Z (3 months ago)
- Topics: yii2-sms-extension, yii2-smser
- Language: PHP
- Size: 18.6 KB
- Stars: 86
- Watchers: 12
- Forks: 35
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-yii2 - yii2-smser
README
# yii2-smser
[![Latest Stable Version](https://poser.pugx.org/daixianceng/yii2-smser/v/stable)](https://packagist.org/packages/daixianceng/yii2-smser) [![Total Downloads](https://poser.pugx.org/daixianceng/yii2-smser/downloads)](https://packagist.org/packages/daixianceng/yii2-smser) [![Latest Unstable Version](https://poser.pugx.org/daixianceng/yii2-smser/v/unstable)](https://packagist.org/packages/daixianceng/yii2-smser) [![License](https://poser.pugx.org/daixianceng/yii2-smser/license)](https://packagist.org/packages/daixianceng/yii2-smser)Yii2 SMS extension (短信扩展)
包含接口:
* [中国云信](http://www.sms.cn/)
* [中国网建](http://www.smschinese.cn/)
* [商信通](http://www.sxtsms.com/)
* [云片网络](http://www.yunpian.com/)
* [云通讯](http://www.yuntongxun.com/)
* [螺丝帽](http://www.luosimao.com/)## Installation
The preferred way to install this extension is through [composer](http://getcomposer.org/download/). Check the [composer.json](https://github.com/daixianceng/yii2-smser/blob/master/composer.json) for this extension's requirements and dependencies.
To install, either run
```
$ php composer.phar require daixianceng/yii2-smser "*"
```or add
```
"daixianceng/yii2-smser": "*"
```to the ```require``` section of your `composer.json` file.
## Usage
```php
return [
'components' => [
'smser' => [
// 中国云信
'class' => 'daixianceng\smser\CloudSmser',
'username' => 'username',
'password' => 'password',
'fileMode' => false
]
],
];
```OR
```php
return [
'components' => [
'smser' => [
// 云片网
'class' => 'daixianceng\smser\YunpianSmser',
'apikey' => '9b11127a9701975c734b8aee81ee3526', // 请替换成您的apikey
'fileMode' => false
]
],
];
``````php
Yii::$app->smser->send('15000000000', '短信内容');
``````php
// 发送模板短信
Yii::$app->smser->sendByTemplate('15000000000', ['123456'], 1);
```## License
**yii2-smser** is released under the BSD 3-Clause License. See the bundled `LICENSE` for details.