当前位置:网站首页>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
边栏推荐
- POW consensus mechanism
- Hanyuan high tech new generation green energy-saving Ethernet access industrial switch high efficiency energy-saving Gigabit Industrial Ethernet switch
- What if the test time is not enough?
- Network foundation and framework
- Js: get the maximum zindex (Z-index) value of the page
- R language is used to build ordered multi classification logistic regression model, ordinal or. The display function obtains the summary statistical information of the ordered logistic regression mode
- How to use androd gradle module dependency replacement
- UI framework
- After the uncommitted transactions in the redo log buffer of MySQL InnoDB are persisted to the redo log, what happens if the transaction rollback occurs?
- ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked.
猜你喜欢

618's money saving technology strategy is coming - experience the scene and get a 10 yuan cat super card!

Go write permissions to file writefile (FileName, data, 0644)?

Can cold plate, submerged and spray liquid cooling lead the development of high-performance computing?

Go写文件的权限 WriteFile(filename, data, 0644)?

Has aaig really awakened its AI personality after reading the global June issue (Part 1)? Which segment of NLP has the most social value? Get new ideas and inspiration ~
![[deeply understand tcapulusdb technology] transaction execution of document acceptance](/img/d9/f6735906a130834c4b3e28de2b2617.png)
[deeply understand tcapulusdb technology] transaction execution of document acceptance

Androd Gradle模块依赖替换如何使用

4E1 PDH optical transceiver 19 inch rack type single fiber transmission 20km E1 interface optical network optical transceiver

Lm05 former VIX (second generation product)

16 channel HD-SDI optical transceiver multi channel HD-SDI HD video optical transceiver 16 channel 3g-sdi HD audio video optical transceiver
随机推荐
R语言glm函数使用频数数据构建二分类logistic回归模型,分析的输入数据为频数数据、将频数数据转化为正常样本数据(拆分、裂变为每个频数对应的样本个数)
R语言使用MASS包的polr函数构建有序多分类logistic回归模型、使用exp函数和coef函数获取模型中每个变量(自变量改变一个单位)对应的优势比(odds ratio)
Can cold plate, submerged and spray liquid cooling lead the development of high-performance computing?
Photon network framework
何小鹏:如果可以回到创业的时候 不会以自己的名字给产品命名
How to solve the task cache compilation problem caused by gradle build cache
20 years' Shanghai station D question Walker (two points, concise)
How did Tencent's technology bulls complete the overall cloud launch?
< Sicily> 1000. number reversal
How do the top ten securities firms open accounts? Is online account opening safe?
Go写文件的权限 WriteFile(filename, data, 0644)?
Gradle Build Cache引发的Task缓存编译问题怎么解决
Unity small demand - simple realization of imitation King Diamond (single draw)
Service stability governance
Homekit and NFC support: smart Ting smart door lock SL1 only costs 149 yuan
DBMS in Oracle_ output. put_ How to use line
In flinksql, the Kafka flow table and MySQL latitude flow table are left joined, and the association is made according to I'd. false
Androd Gradle模块依赖替换如何使用
js: 获取页面最大的zIndex(z-index)值
Js: get the maximum zindex (Z-index) value of the page