微信公众号发送模板消息,返回码errcode为0,但是手机上收不到消息?
每100条消息中有十几二十条没有收到消息,但是返回的都是如下信息,请问这是哪里的问题呢?
array(6) {
["code"]=>
string(3) "200"
["status"]=>
string(2) "OK"
["responseline"]=>
string(15) "HTTP/1.0 200 OK"
["headers"]=>
array(4) {
["Connection"]=>
string(5) "close"
["Content-Type"]=>
string(32) "application/json; encoding=utf-8"
["Date"]=>
string(29) "Sat, 30 May 2020 02:39:00 GMT"
["Content-Length"]=>
string(2) "55"
}
["content"]=>
string(55) "{"errcode":0,"errmsg":"ok","msgid":1362545989848219654}"
["meta"]=>
string(198) "HTTP/1.0 200 OK
Connection: close
Content-Type: application/json; encoding=utf-8
Date: Sat, 30 May 2020 02:39:00 GMT
Content-Length: 55
{"errcode":0,"errmsg":"ok","msgid":1362545989848219654}"
}
你好,建议检查一下是否使用UTF-8编码,同时要避免使用emoji之类的特殊字符(一些新加入的字符,可能各平台的码表里不一定有,客户端可能不支持)。服务号的模板消息,可以看看是否收到了事件推送,如果是收到成功的事件推送,但是用户没收到,一般是编码问题。若排查后仍然没有问题,请把详细的HTTP请求报文打下来给我们排查。
服务号模板消息事件推送请参考:https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Template_Message_Interface.html
string(28) "ovCwk1lCQs_bsYiTmmxkzdx2jjdc"
["template_id"]=>
string(43) "KJdsp27zGlRvTswxvFJFgmpv466esg4iaOKSb2GMV6E"
["url"]=>
string(18) "www.xxx.com/index/"
["data"]=>
array(6) {
["first"]=>
array(2) {
["value"]=>
string(70) "亲爱的小信,您的小孩小信于2020-07-07 15:30:07进行考勤"
["color"]=>
string(7) "#0d47a1"
}
["keyword1"]=>
array(2) {
["value"]=>
string(6) "测试"
["color"]=>
string(7) "#0d47a1"
}
["keyword2"]=>
array(2) {
["value"]=>
string(12) "考勤系统"
["color"]=>
string(7) "#0d47a1"
}
["keyword3"]=>
array(2) {
["value"]=>
string(19) "2020-07-07 15:30:07"
["color"]=>
string(7) "#0d47a1"
}
["keyword4"]=>
array(2) {
["value"]=>
string(12) "考勤抓拍"
["color"]=>
string(7) "#0d47a1"
}
["remark"]=>
array(2) {
["value"]=>
string(12) "进校门了"
["color"]=>
string(7) "#0d47a1"
}
}