• <i id="dbPct"><sup id="dbPct"><mark id="dbPct"><dl id="dbPct"><span id="dbPct"><caption id="dbPct"><dl id="dbPct"><small id="dbPct"><output id="dbPct"><optgroup id="dbPct"></optgroup></output><aside id="dbPct"></aside><ul id="dbPct"></ul></small><label id="dbPct"></label></dl></caption></span></dl></mark><strike id="dbPct"></strike><figure id="dbPct"></figure></sup></i>
          1. <sub id="dbPct"></sub>
              1. 阿里云短信发送类

                浏览:788 最后更新:2019-11-13 13:09 分类:类库 关键字: 阿里云 短信
                bingher/ali-smshttps://github.com/hbh112233abc/ali-sms
                安装composer require bingher/ali-sms配置文件config/ali_sms.php<?php
                return [
                    'version' => '2019-11-13',
                    'host' => 'dysmsapi.aliyuncs.com',
                    'scheme' => 'http',
                    'region_id' => 'cn-hangzhou',
                    'access_key' => '',
                    'access_secret' => '',
                    'product' => '海迈电子档案平台',
                    'actions' => [
                        'register' => [
                            'sign_name' => '注册验证',
                            'template_code' => 'SMS_67105498',
                            'template_param' => [
                                'code' => '',
                                'product' => '',
                            ]
                        ],
                        'login' => [
                            'sign_name' => '登录验证',
                            'template_code' => 'SMS_67105500',
                            'template_param' => [
                                'code' => '',
                                'product' => '',
                            ]
                        ],
                        'change_password' => [
                            'sign_name' => '变更验证',
                            'template_code' => 'SMS_67105496',
                            'template_param' => [
                                'code' => '',
                                'product' => '',
                            ]
                        ],
                    ],
                ];

                调用示例:<?php
                use bingher\sms\facade\ThinkAliSms;

                ThinkAliSms::login('18759201xxx',['code'=>123456]);
                传参为:手机号,template_param数组

                特色功能,通过配置actions内容即可调用
                如以上配置包含三个调用方式:ThinkAliSms::login('18759201xxx',['code'=>123456]);
                ThinkAliSms::register('18759201xxx',['code'=>123456]);
                ThinkAliSms::change_password('18759201xxx',['code'=>123456]);
                //或
                ThinkAliSms::changePassword('18759201xxx',['code'=>123456]);
                如果我们在actions中增加配置  ...
                  'actions' => [
                        'register' => [
                            'sign_name' => '注册验证',
                            'template_code' => 'SMS_67105498',
                            'template_param' => [
                                'code' => '',
                                'product' => '',
                            ]
                        ],
                        'login' => [
                            'sign_name' => '登录验证',
                            'template_code' => 'SMS_67105500',
                            'template_param' => [
                                'code' => '',
                                'product' => '',
                            ]
                        ],
                        'change_password' => [
                            'sign_name' => '变更验证',
                            'template_code' => 'SMS_67105496',
                            'template_param' => [
                                'code' => '',
                                'product' => '',
                            ]
                        ],
                        'coupon' => [
                            'sign_name' => '优惠券',
                            'template_code' => 'SMS_6710xxxx',
                            'template_param' => [
                                'coupon_code' => '',
                                'exprise_date' => '',
                            ]
                        ],
                    ],
                那么我们就可以按一下调用优惠券的短信了ThinkAliSms::coupon('18759201xxx',['coupon_code'=>123456,'exprise_date'=>'2019-11-13']);更多详情可以查看https://github.com/hbh112233abc/ali-sms
                评论( 相关
                后面还有条评论,点击查看>>