我购买了短信包,编写了云函数如下:
exports.main = async (event, context) => {
try {
const result = await cloud.openapi.cloudbase.sendSms({
"env": 'cloud1-6gvg3jh35e51fb99',
"content": '发布了新的能力!!ljh1',
"path": '/index.html',
"phoneNumberList": [
"+861866077XXXX"
],
"sms_type": 'Notification',
"template_id": '10000022',
"template_param_list":
['232324','登录','5'
]
})
return result
} catch (err) {
return err
}
}
部署后,发送短信不报错,内容如下:
我一直收不到短信,到底是什么原因呢?
const result = await cloud.openapi.cloudbase.sendSms({
"env": envid, // 环境ID
"phone_number_list":
["+861777777xxxx"
],
"sms_type": 'Notification',
"template_id": '10000022',
"template_param_list":
['232324','登录','5'
]
});