def sendTemplateSMS(to, datas, tempId): # 初始化REST SDK rest = REST(_serverIP, _serverPort, _softVersion) rest.setAccount(_accountSid, _accountToken) rest.setAppId(_appId) result = rest.sendTemplateSMS(to, datas, tempId)
def send_template_sms(to, datas, tempId): """ 云通讯官方提供的发送短信代码实例 :param to: 手机号码 :param datas: 内容数据 格式为列表 例如:['123456', '5'],如不需替换请填 '' :param tempId: 模板Id :return: 成功、失败 """ # 初始化REST SDK rest = REST(_serverIP, _serverPort, _softVersion) rest.setAccount(_accountSid, _accountToken) rest.setAppId(_appId) # 调用发送短信的接口函数 result = rest.sendTemplateSMS(to, datas, tempId) print(result)