1 Star 1 Fork 0

嗝嗝 / alisms

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

阿里云短信

项目介绍

阿里云短信发送sdk

软件架构

src         模块目录

├─ Alisms        核心目录
        
    ├─ Lib         依赖目录

         ├─ SignatureHelper.php         阿里云短信依赖库。
         
    ├─ Alisms.php            阿里云短信使用类。

本扩展 1.0.0 及以上版本,运行环境要求PHP7.2以上。

安装教程

  1. 码云git@github.com:china-wangyu/WeChat.git

  2. 使用 composer 安装

    由于众所周知的原因,国外的网站连接速度很慢。因此安装的时间可能会比较长,我们建议通过下面的方式使用国内镜像。打开命令行窗口(windows用户)或控制台(Linux、Mac 用户)并执行如下命令:

        composer config -g repo.packagist composer https://packagist.phpcomposer.com

    使用: 在composer.json添加

     "require": {
         "china-wangyu/alisms": "^1.0.0"
     },

    然后(命令行):

     composer update

使用说明

  1. 加载命名空间

     use Alisms\Alisms;
  2. 实例化阿里云短信类

     /**
      * Alisms constructor.
      * @param string $accessKeyId   阿里云授权ID
      * @param string $accessKeySecret   阿里云授权secret
      * @param string $SignName  阿里云短信签名
      * @param string $TemplateCode  短信模板code
      */
     $alisms = new Alisms($accessKeyId',$accessKeySecret,$SignName,$TemplateCode);
  3. 发送短信

     /**
      * 发送短信
      * @param string $PhoneNumbers  手机号
      * @param array $TemplateParam  短信参数
      * @param string $OutId     流水号设置
      * @return bool|\stdClass   返回结果
      * @throws \Exception
      */
     $res = $alisms->sendSms($PhoneNumbers, $TemplateParam, $OutId);
  4. 返回值

    成功:

         object(stdClass)#149 (4) {
           ["Message"] => string(2) "OK"
           ["RequestId"] => string(36) "EB122598-B375-4644-83E5-D29A6EFA1EA2"
           ["BizId"] => string(20) "385624341141883468^0"
           ["Code"] => string(2) "OK"
         }

    失败:

         object(stdClass)#149 (3) {
           ["Message"] => string(30) "触发分钟级流控Permits:1"
           ["RequestId"] => string(36) "AE9A8B71-ABE8-4EDC-B10E-2123842EEA33"
           ["Code"] => string(26) "isv.BUSINESS_LIMIT_CONTROL"
         }

参与贡献

  1. Fork 本项目
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request

联系作者

注:如有疑问,请联系邮箱 china_wangyu@aliyun.com

或,请联系QQ 354007048 / 354937820

The MIT License (MIT) Copyright (c) 2018 china_wangyu Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

阿里云短信发送sdk 展开 收起
PHP
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
PHP
1
https://gitee.com/china_wangyu/ali_cloud_sms.git
git@gitee.com:china_wangyu/ali_cloud_sms.git
china_wangyu
ali_cloud_sms
alisms
master

搜索帮助