微信模板消息Notification
我们为您内置了微信模板消息 Notification
, 您可以直接使用该 Notification
,您也可以自建 Notification
与微信模板消息频道搭配。use Chowjiawei\Helpers\Notifications\WechatTemplateMessageNotification;
- 不指定用户(广播用户)
Notification::route('WechatTemplateMessage', null)->notify(new WechatTemplateMessageNotification($data));
- 指定用户
$user=['odAYnxOVy7vS266666666','odAYnxEuuTCf66666fov276666'];
$template="iA2V1K45vS8IgUEvE666666EH3R-V-66666";
$data=[
"order_id"=>[
"value"=>"20200414234478934343",
"color"=>"#173177"
],
"package_id"=>[
"value"=>"SF4345454534",
"color"=>"#173177"
],
"remark"=>[
"value"=>'模板消息发送',
"color"=>"#173177"
]
];
Notification::route('WechatTemplateMessage', $user)->notify(new WechatTemplateMessageNotification($data, $template));
推荐文章: