<i id="aEXfi"><fieldset id="aEXfi"><em id="aEXfi"><cite id="aEXfi"><kbd id="aEXfi"></kbd></cite></em></fieldset></i><meter id="aEXfi"><p id="aEXfi"><hgroup id="aEXfi"></hgroup></p></meter>

      • <aside id="aEXfi"><kbd id="aEXfi"></kbd></aside>

          <source id="aEXfi"><ins id="aEXfi"></ins></source>
          • 阿里云短信发送类

            浏览:846 最后更新:2019-11-20 13:09 分类:类库 关键字: 阿里云 短信
            bingher/ali-smshttps://github.com/hbh112233abc/ali-sms
            安装composer require bingher/ali-sms配置文件config/ali_sms.php<?php
            return [
                'version' => '2019-11-20',
                '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-20']);更多详情可以查看https://github.com/hbh112233abc/ali-sms
            评论( 相关
            后面还有条评论,点击查看>>