云短信

免费
类型 应用插件
版本 1.0.1
版本更新时间 2023-03-04
大小 17.74 KB
开发商
官方
评分

详细介绍

云短信应用插件,支持阿里云、腾讯云

接口

use plugin\sms\api\Sms;

Sms::send($mobile, [
    'content'  => '您的验证码为: 6379',
    'template' => 'SMS_001',
    'data' => [
        'code' => 6379
    ]
]);

// 指定厂商
Sms::send($mobile, [
    'content'  => '您的验证码为: 6379',
    'template' => 'SMS_001',
    'data' => [
        'code' => 6379
    ]
], ['aliyun', 'qcloud']);

// 发国际短信
use Overtrue\EasySms\PhoneNumber;
// 发送到国际码为 31 的国际号码
$number = new PhoneNumber(13188888888, 31);
Sms::send($mobile, [
    'content'  => '您的验证码为: 6379',
    'template' => 'SMS_001',
    'data' => [
        'code' => 6379
    ]
]);

按照标签发送

v1.0.1 新增

use plugin\sms\api\Sms;
$tagName = 'captcha';
Sms::sendByTag(13188888888, $tagName, [
    'code' => 'xxx'
]);

添加标签

截图

提示
腾讯云是类似的操作,不再重复演示

安装使用

请使用webman-admin 的插件市场安装使用。

提示
此插件依赖 overtrue/easy-sms,请使用命令 composer require overtrue/easy-sms 安装(需restart重启)

版本历史记录
1.0.1
2023-03-04
增加标签功能
1.0.0
2023-03-01
支持阿里云、腾讯云、百度云、螺丝帽等厂商
评分及评论
5 满分5分
mangoing 2023-11-14
建议增加华为云,另外如果能识别手机号,不同国家的手机号能选择发送模版。
shuopeng666 2023-09-01
关于“短信标签captcha不存在”可以在后台新增一个名字叫captcha的标签,按照你的短信服务商填写 厂商标签ID 、厂商签名 ,拿腾讯云举例:厂商标签ID-->正文模板里的ID;厂商签名-->签名管理的签名内容 (或者你在代码中自己再修改下 位置在plugin/sms/api/sendByTag中打印下$templates就明白了,不太建议这么做),
rbac_bin 2023-08-03
为啥我安装云短信在后台配置腾讯云后,在绑定手机发送验证码提示:短信标签 captcha 不存在
小菜 2023-04-12
厂商选择的 阿里云 接口返回All the gateways have failed. You can get error details by `$exception->getExceptions()`
walkor 2023-03-01
🎉🎉🎉老规矩,谁差评封谁账号 🎉🎉🎉
ab0029 2023-03-01
很实用
🔝