我购买了短信包,编写了云函数如下:
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'
]
});
const cloud = require('wx-server-sdk');cloud.init({env: cloud.DYNAMIC_CURRENT_ENV,});exports.main = async (event, context) => {try {const result = await cloud.openapi.cloudbase.sendSms({"env": 'cloud1-9g3pnv3vf7c8ae07',"sms_type": 'Notification',"template_id": '10000022',"template_param_list":[event.code,'登录','5'],"phoneNumberList": ["+86"+event.phone],// "smsType": 'Marketing',// "useShortName": true});return result;} catch (err) {return err;}};