当前 Bug 的表现(可附上截图)
- 预期表现
{
"touser": "ovGr-jmcHzFtZemn_yQme891ksrA",
"msgtype": "text",
"text": {
"content": "< a href=\"http://m.huajialishe.com\" data-miniprogram-appid=\"wx64b88b7deae66cee\" data-miniprogram-path=\"pages/index/index\">点击跳小程序</ a >"
}
}
|
- 复现路径
https://mp.weixin.qq.com/debug?token=374098845&lang=zh_CN 我用官方测试的都给我直接转义了
- 提供一个最简复现 Demo
有很多公众号都可以文本带链接的。
这个问题好解决的,你通过客服消息发小程序,把content,urlencode一下在发送就好了。
$content
=
$this
->message[
'content'
];
$text
=
"<a href='http://www.qq.com' data-miniprogram-appid='wxa8a4d4XXXXXX' data-miniprogram-path='pages/index/index'>礼品卡,你送礼,我帮你</a>"
;
$custom
=
array
(
'msgtype'
=>
'text'
,
'text'
=>
array
(
'content'
=> urlencode(
$text
)),
'touser'
=>
$this
->message[
'from'
],
);
$account_api
= WeAccount::create();
$result
=
$account_api
->sendCustomNotice(
$custom
);
效果如下:
解决了你的问题,记得点赞关注一下!
这个不是bug吧,官方有说过可以这么用吗?
这个是模板消息才能跳过去的吧