小程序
小游戏
企业微信
微信支付
扫描小程序码分享
2 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
你看的那个是公众号的文档,小程序看这个https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/subscribe-message/subscribeMessage.send.html
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
let res = await rp({
url: "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" + access_token,
method: 'POST',
body: JSON.stringify({
"touser": open.data[i].openid,
"template_id": "ujTmUWuS4BZMKpnrBEfJS4_2J34w3cfVS7kMzqg4hWI",
"topcolor": "#FF0000",
"data": {
"first": {
"value": "您有新的订单,请及时处理",
"color": "#173177"
},
"keyword1": {
"value": event.username,
"keyword2": {
"value": event.phone,
"keyword3": {
"value": event.storename,
"keyword4": {
"value": event.geton,
"keyword5": {
"value": event.day+" "+event.menuName,
"remark": {
"value": event.price+"元",
}
})
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
你看的那个是公众号的文档,小程序看这个https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/subscribe-message/subscribeMessage.send.html
let res = await rp({
url: "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" + access_token,
method: 'POST',
body: JSON.stringify({
"touser": open.data[i].openid,
"template_id": "ujTmUWuS4BZMKpnrBEfJS4_2J34w3cfVS7kMzqg4hWI",
"topcolor": "#FF0000",
"data": {
"first": {
"value": "您有新的订单,请及时处理",
"color": "#173177"
},
"keyword1": {
"value": event.username,
"color": "#173177"
},
"keyword2": {
"value": event.phone,
"color": "#173177"
},
"keyword3": {
"value": event.storename,
"color": "#173177"
},
"keyword4": {
"value": event.geton,
"color": "#173177"
},
"keyword5": {
"value": event.day+" "+event.menuName,
"color": "#173177"
},
"remark": {
"value": event.price+"元",
"color": "#173177"
},
}
})
})