当前位置:网站首页>CRMEB 二开短信功能教程
CRMEB 二开短信功能教程
2022-06-23 12:56:00 【CRMEB】
知识付费短信功能同时支持阿里云短信和 crmeb 短信,我们使用时只需要二选一即可。
那么我们如何二开阿里云短信功能呢?
第一步:首先进入阿里云控制台,在阿里云短信模块,申请需要新加的短信模版
第二步:在知识付费总后台 -> 系统维护 -> 开发配置 -> 配置分类 -> 短信配置下加新的短信模版 id 储存配置

点击 “短信配置” 名称,进入短信配置下的子配置

点击添加配置,选择‘文本框’类型,填写下面的配置,提交配置

提交完成后,进入 “系统设置 -> 系统设置 -> 阿里云配置 -> 短信配置”,在这里我们可以看到我们新加的短信模版 id 配置。

第三步:调取阿里云短信接口,发送短信
知识付费源码的根目录”extend/service/AliMessageService” 下的 sendmsg 方法为阿里云短信的发送方法;
$tel:接收手机号
$setTemplateCode :短信模版 ID
$setTemplateParam :短信内容 参数为数组
$setOutId :可以为空
/**
* 发送短信
* @param string $tel 短信接收号码
* @param string $setSignName 短信签名
* @param string $setTemplateCode 短信模板ID
* @param array $setTemplateParam 短信内容
* @param string $setOutId 外部流水扩展字段
*/
public static function sendmsg($tel = '', $setTemplateCode = '', $setTemplateParam = [], $setOutId = '')
{
try {
self::init();
$result = AlibabaCloud::rpc()
->product('Dysmsapi')
->version('2017-05-25')
->action('SendSms')
->method('POST')
->host('dysmsapi.aliyuncs.com')
->options([
'query' => [
'RegionId' => "cn-hangzhou",
'PhoneNumbers' => $tel,
'SignName' => SystemConfigService::get('smsSignName'),
'TemplateCode' => $setTemplateCode,
'TemplateParam' => json_encode(is_array($setTemplateParam) ? $setTemplateParam : ['code' => $setTemplateParam]),
],
])->request()->toArray();
return $result;
} catch (ClientException $e) {
return false;
} catch (ServerException $e) {
return false;
}
}
如果发送短信呢?
AliMessageService::sendmsg( t e l , tel, tel,setTemplateCode,$setTemplateParam);
例如我们的登录验证码的发送

p h o n e 是 接 收 的 手 机 号 , phone 是接收的手机号, phone是接收的手机号,smsTemplateCode 是短信模版 ID ,[‘code’ => $code] 就是短信的内容了;这样就发送成功了。
源码附件已经打包好上传到百度云了,大家自行下载即可~
链接: https://pan.baidu.com/s/14G-bpVthImHD4eosZUNSFA?pwd=yu27
提取码: yu27
百度云链接不稳定,随时可能会失效,大家抓紧保存哈。
如果百度云链接失效了的话,请留言告诉我,我看到后会及时更新~
开源地址
码云地址:
http://github.crmeb.net/u/defu
Github 地址:
http://github.crmeb.net/u/defu
边栏推荐
- The two 985 universities share the same president! School: true
- 在線文本過濾小於指定長度工具
- 2-optical-2-electric cascaded optical fiber transceiver Gigabit 2-optical-2-electric optical fiber transceiver Mini embedded industrial mine intrinsic safety optical fiber transceiver
- Hanyuan high tech USB2.0 optical transceiver USB2.0 optical fiber extender USB2.0 optical fiber transmitter USB2.0 interface to optical fiber
- Restcloud ETL resolves shell script parameterization
- 快速了解常用的非对称加密算法,再也不用担心面试官的刨根问底
- Androd Gradle模块依赖替换如何使用
- How about stock online account opening and account opening process? Is it safe to open a mobile account?
- .Net怎么使用日志框架NLog
- 逆向调试入门-了解PE结构文件
猜你喜欢

How to enable the SMS function of alicloud for crmeb knowledge payment

Analyse et résolution des défaillances de connexion causées par MySQL utilisant replicationconnection

腾讯的技术牛人们,是如何完成全面上云这件事儿的?

DBMS in Oracle_ output. put_ How to use line

Qunhui 10 Gigabit network configuration and test

#yyds干货盘点# 解决剑指offer: 判断是不是平衡二叉树

Hanyuan hi tech 8-way telephone +1-way 100M Ethernet RJ11 telephone optical transceiver 8-way PCM telephone optical transceiver

Go寫文件的權限 WriteFile(filename, data, 0644)?

"Four highs" of data midrange stability | startdt Tech Lab 18

Hanyuan hi tech 1-way uncompressed 4k-dvi optical transceiver 4K HD uncompressed DVI to optical fiber 4k-dvi HD video optical transceiver
随机推荐
64 channel telephone +2-channel Gigabit Ethernet 64 channel PCM telephone optical transceiver voice telephone to optical fiber
Photon network framework
R language uses the polR function of mass package to build an ordered multi classification logistic regression model, and uses exp function and coef function to obtain the corresponding odds ratio of
Based on your work experience, talk about the quality system construction in software testing
How to enable the SMS function of alicloud for crmeb knowledge payment
Yyds dry inventory solution sword finger offer: judge whether it is a balanced binary tree
Androd Gradle模块依赖替换如何使用
[Yunzhou said live room] - digital security special session will be officially launched tomorrow afternoon
sed -i命令怎么使用
R语言glm函数使用频数数据构建二分类logistic回归模型,分析的输入数据为频数数据、将频数数据转化为正常样本数据(拆分、裂变为每个频数对应的样本个数)
AAIG看全球6月刊(上)发布|AI人格真的觉醒了吗?NLP哪个细分方向最具社会价值?Get新观点新启发~
[website architecture] the unique skill of 10-year database design, practical design steps and specifications
React query tutorial ④ - cache status and debugging tools
2022软科大学专业排名出炉!西电AI专业排名超清北,南大蝉联全国第一 !
Germancreditdata of dataset: a detailed introduction to the introduction, download and use of germancreditdata dataset
【网站架构】10年数据库设计浓缩的绝技,实打实的设计步骤与规范
"Four highs" of data midrange stability | startdt Tech Lab 18
Synergetic process
js: 获取页面最大的zIndex(z-index)值
First exposure! The only Alibaba cloud native security panorama behind the highest level in the whole domain