微信模版消息

This commit is contained in:
ASUS 2025-10-20 18:59:52 +08:00
parent 433d67a17d
commit 767c20cb8b
1 changed files with 4 additions and 0 deletions

View File

@ -95,6 +95,10 @@ class SendWechatTemp implements Consumer
'response_type' => 'array',
];
$app = Factory::officialAccount($config);
$acc_token = Redis::get('wx:ac:AccessToken');
if($acc_token) {
$app['access_token']->setToken($acc_token);
}
$wechat_res = $app->template_message->send([
'touser' => $user['wechat_ac_open_id'],
'template_id' => 'hGsUGZlWqWC9TMm4ZGZuz0OwE4gwSmvgbr5ecmTDvq4',