当前位置:网站首页>CRMEB 二开短信功能教程
CRMEB 二开短信功能教程
2022-06-23 16:49: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($tel,$setTemplateCode,$setTemplateParam);
例如我们的登录验证码的发送

$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
边栏推荐
- Self supervised learning (SSL)
- Réponse 02: pourquoi le cercle Smith peut - il "se sentir haut et bas et se tenir à droite et à droite"?
- QT layout manager [qvboxlayout, qhboxlayout, qgridlayout]
- Kdevtmpfsi processing of mining virus -- Practice
- Codeforces Round #620 (Div. 2)ABC
- How can the points mall make profits
- The principle of MySQL index algorithm and the use of common indexes
- C. Phoenix and Towers-Codeforces Global Round 14
- 微信小程序:酒店预计到店日期的时间选择器
- How important is 5g dual card dual access?
猜你喜欢

Easyplayer mobile terminal plays webrtc protocol for a long time. Pressing the play page cannot close the "about us" page

qYKVEtqdDg

Wechat applet: time selector for the estimated arrival date of the hotel

查数据库中每张表的大小
![[30. concatenate substrings of all words]](/img/e7/453c8524a23fbb7501e85140547ce1.png)
[30. concatenate substrings of all words]

C # connection to database

微信小程序:酒店预计到店日期的时间选择器

时间戳90K是什么意思?

Meituan Sanmian: how do you understand the principle of redis master-slave replication?

Practice sharing of chaos engineering in stability management of cloud native Middleware
随机推荐
Hands on data analysis unit 2 section 4 data visualization
C # connection to database
混沌工程在云原生中间件稳定性治理中的实践分享
How to configure MySQL log management
Codeforces Round #620 (Div. 2)ABC
qYKVEtqdDg
Answer 02: why can Smith circle "allow left string and right parallel"?
C. Phoenix and Towers-Codeforces Global Round 14
Read the typical application circuit of microphone
Redis ubuntu18.04.6 intranet deployment
console. Log() is an asynchronous operation???
FPN characteristic pyramid network
Petitpotam – NTLM relay to ad CS
Intelligent supply chain collaborative management solution for logistics industry
hands-on-data-analysis 第二单元 第四节数据可视化
. Net cloud native architect training camp (responsibility chain mode) -- learning notes
C#与数据库连接
时间戳90K是什么意思?
Spdlog logging example - create a logger using sink
Is it cost-effective to buy a long-term financial product?