https://api.weixin.qq.com/cgi-bin/token
Use the appid and secret of the official account to get the access_token information through the above connection
https://api.weixin.qq.com/cgi-bin/message/template/send
After obtaining the access_token, use this link to send information to the specified user through the official account
The miniprogram parameter is not used when adding a public account when using the WeChat applet
{
"touser": "OPENID",
"template_id": "ngqIpbwh8bUfcSsECmogfXcV14J0tQlEpBO27izEYtY",
"url": "http://weixin.qq.com/download",
"miniprogram":{
"appid": "xiaochengxuappid12345",
"pagepath ":"index?foo=bar"
},
"data":{
"first": {
"value": "Congratulations on your successful purchase!",
"color":"#173177"
},
"keyword1":{
"value ": "chocolate",
"color": "#173177"
},
"keyword2": {
"value": "39.8 yuan",
"color": "#173177"
},
"keyword3": {
"value": " September 22, 2014",
"color": "#173177"
},
"remark":{
"value": "Welcome to buy again!",
"color":"#173177"
}
}
}