hegzh/aliyun-sms 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

hegzh/aliyun-sms

Composer 安装命令:

composer require hegzh/aliyun-sms

包简介

阿里大于短信服务PHP SDK的composer封装

README 文档

README

阿里云短信服务 PHP SDK 的 composer 封装

TP5

帮助文档

Thinkphp 5 config 配置信息

$config['alidayu'] = [
        'app_key' => 'LTAIRdKEkYqxxxxx',
        'app_secret' => '6Vfl3lBuHexxxxxxxxxxxxxxxx',
        'signature' => '签名',
        ];

Examples

<?php
use hegzh\AliyunSms\AliyunSms;

$mobile = "13800138000"; //国内手机号码
$templateCode = "SMS_75990000"; //短信模板 阿里云上申请
$templateParms = ['customer' => 'hegzh'];//短信模板变量参数
$bizId = 1111; //短信业务流水id

$sms = new AliyunSms();
//发送短信
$res = $sms->sendSms($mobile, $templateCode, $templateParms, $bizId);
Response:
{
    "state": false, //发送状态
    "code": "InvalidAccessKeyId.NotFound", //错误编码
    "error": "Specified access key is not found.", //错误消息
}

//查询短信记录
$date = "20170720";
$res = $sms->getSmsDetails($mobile, $date);
Response:
{
    "state": true, //返回状态
    "total": 2, //总记录数
    'code' => 'InvalidAccessKeyId.NotFound', //错误编码
    'error' => 'Specified access key is not found.', //错误消息
    "data": [
        {
            "OutId": "277770", //外部流水id
            "SendDate": "2017-07-21 11:11:25", //发送情趣时间
            "SendStatus": 3, //发送状态
            "ReceiveDate": "2017-07-21 11:11:25", //接收时间
            "ErrCode": "DELIVRD", //错误代码
            "TemplateCode": "SMS_75990400", // 短信模板编码
            "Content": "【签名】尊敬的hegzh,欢迎您使用阿里大鱼短信服务,阿里大鱼将为您提供便捷的通信服务!",
            "PhoneNum": "13800138000", //手机号码
        }
    ]
}
?>

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-07-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固