定制 xiaochengfu/yii2-mns 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

xiaochengfu/yii2-mns

Composer 安装命令:

composer require xiaochengfu/yii2-mns

包简介

阿里云、云片短信推送,yii2-mns

README 文档

README

阿里云、云片短信推送

Installation

The preferred way to install this extension is through composer.

Either run

composer require xiaochengfu/yii2-mns "v1.0.1"

or add

"xiaochengfu/yii2-mns": "*"

to the require section of your composer.json file.

Usage

1.在主配置文件中增加components

'components' => [
      'mns'=>[
                 'class'=> 'xiaochengfu\mns\Module',
                 'config'=>[
                     'aliyun'=>[
                         'active'=>true, //true位开启,false为关闭
                         'accessId' => 'xxxx',
                         'accessKey' => 'xxxxxxxxx',
                         'endpoint' => 'http://xxxx.mns.cn-hangzhou.aliyuncs.com/',
                         'topicName' => 'xxx',
                         'smsSignName' => 'xxxx',
                     ],
                     'yunpian' => [
                         'active'=>false,
                         'apikey' => 'xxxxxx', // 请替换成您的apikey
                     ]
                 ]

             ],
]

2.在程序中使用:

当使用云片时:

$smsParams = '具体的消息内容';

当使用阿里云时:

$smsParams = [
    'code'=>'xxx',
    'product'=>'xxx'
];

单条发送:

Yii::$app->mns->send('186********',$smsParams,MnsComponent::YZM);

//批量发送

$mobile = ['phone1','phone2','phone3'];
$result = Yii::$app->mns->batchSend($mobile,$smsParams,MnsComponent::YZM);

$smsParams与MnsComponent::YZM的类型要一致,这里可以根据自己的模板id自行定义规则!

统计信息

  • 总下载量: 34
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2017-08-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固