$openid = XXX;
$template_id = “ti6LHLH0RqF9TGY5HVljwaXZL9_NjY_0M3NqHf1_4Qs”;
if ($openid){
$sendData = [
“touser”=>$openid.””,
“template_id”=>$template_id,
“url”=>”http://www.xjcode.com”,
“data”=>[
“first”=>[
“value”=>”您购买的商品已经被取消”,
“color”=>”#173177”
],
“keyword1″=>[
“value”=>$order[\’order_id\’],
“color”=>”#173177”
],
“keyword2″=>[
“value”=>$order[\’cancel_reason\’],
“color”=>”#173177”
],
“keyword3″=>[
“value”=>$order[\’gamename\’],
“color”=>”#173177”
],
“keyword4″=>[
“value”=>$order[\’ordername\’],
“color”=>”#173177”
],
“keyword5″=>[
“value”=>$order[\’buyrole\’],
“color”=>”#173177”
],
“remark”=>[
“value”=>”如有疑问可以直接在公众号内联系客服”,
“color”=>”#173177”
],
],
];
$token = AdminWechat::model()->getWxAccessToken();
if ($token){
MongoService::model()->insert(\’weixin_debug\’,[\’error\’=>2]);
$toUrl = “https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=”.$token;
$sendData = json_encode($sendData);
CurlsUtil::post($toUrl,$sendData);
}

版权声明:本文为linzy原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/linzy/p/6794949.html