切换导航条
此项目
正在载入...
登录
潘浩文
/
scoreshop
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
潘浩文
6 years ago
提交
4bb5291106b2c097b6338f2f4416bea9585d818b
1 个父辈
bad66f8e
1 个管道 的构建
通过
耗费 0 秒
1
变更
2
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
1 行增加
和
75 行删除
app/portal/service/MobileService.php
app/portal/service/SendTemplateSMSService.php
app/portal/service/MobileService.php
查看文件 @
4bb5291
...
...
@@ -12,7 +12,7 @@ class MobileService{
*/
function
sendTemplateSMS
(
$to
,
$datas
,
$tempId
)
{
include_once
(
"
./
CCPRestSmsSDK.php"
);
include_once
(
"CCPRestSmsSDK.php"
);
// 初始化REST SDK
//主帐号,对应开官网发者主账号下的 ACCOUNT SID
$accountSid
=
'13821821000'
;
...
...
app/portal/service/SendTemplateSMSService.php
已删除
100644 → 0
查看文件 @
bad66f8
<?php
/*
* Copyright (c) 2014 The CCP project authors. All Rights Reserved.
*
* Use of this source code is governed by a Beijing Speedtong Information Technology Co.,Ltd license
* that can be found in the LICENSE file in the root of the web site.
*
* http://www.yuntongxun.com
*
* An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
namespace
app\portal\service
;
class
Mobile
{
/**
* 发送模板短信
* @param to 手机号码集合,用英文逗号分开
* @param datas 内容数据 格式为数组 例如:array('Marry','Alon'),如不需替换请填 null
* @param $tempId 模板Id,测试应用和未上线应用使用测试模板请填写1,正式应用上线后填写已申请审核通过的模板ID
*/
function
sendTemplateSMS
(
$to
,
$datas
,
$tempId
)
{
include_once
(
"./CCPRestSmsSDK.php"
);
// 初始化REST SDK
//主帐号,对应开官网发者主账号下的 ACCOUNT SID
$accountSid
=
'13821821000'
;
//主帐号令牌,对应官网开发者主账号下的 AUTH TOKEN
$accountToken
=
'suntata12345'
;
//应用Id,在官网应用列表中点击应用,对应应用详情中的APP ID
//在开发调试的时候,可以使用官网自动为您分配的测试Demo的APP ID
$appId
=
''
;
//请求地址
//沙盒环境(用于应用开发调试):sandboxapp.cloopen.com
//生产环境(用户应用上线使用):app.cloopen.com
$serverIP
=
'app.cloopen.com'
;
//请求端口,生产环境和沙盒环境一致
$serverPort
=
'8883'
;
//REST版本号,在官网文档REST介绍中获得。
$softVersion
=
'2013-12-26'
;
$rest
=
new
REST
(
$serverIP
,
$serverPort
,
$softVersion
);
$rest
->
setAccount
(
$accountSid
,
$accountToken
);
$rest
->
setAppId
(
$appId
);
// 发送模板短信
$result
=
$rest
->
sendTemplateSMS
(
$to
,
$datas
,
$tempId
);
if
(
$result
==
NULL
)
{
echo
"result error!"
;
return
2
;
}
if
(
$result
->
statusCode
!=
0
)
{
echo
"error code :"
.
$result
->
statusCode
.
"<br>"
;
echo
"error msg :"
.
$result
->
statusMsg
.
"<br>"
;
return
0
;
//TODO 添加错误处理逻辑
}
else
{
echo
"Sendind TemplateSMS success!<br/>"
;
// 获取返回信息
$smsmessage
=
$result
->
TemplateSMS
;
echo
"dateCreated:"
.
$smsmessage
->
dateCreated
.
"<br/>"
;
echo
"smsMessageSid:"
.
$smsmessage
->
smsMessageSid
.
"<br/>"
;
return
1
;
//TODO 添加成功处理逻辑
}
}
}
?>
请
注册
或
登录
后发表评论