<canvas id="vslWQ"><legend id="vslWQ"><legend id="vslWQ"><bdo id="vslWQ"></bdo></legend></legend></canvas>
        <dl id="vslWQ"><i id="vslWQ"><object id="vslWQ"></object></i></dl>

          阿里云短信发送类

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