templateId='8yrOrbG91C30LJapcBgQLINY3Lq9CZuAVbEsQMPcpnE'; // $this->url='http://weidian.jiuweiyun.cn/web/user'; $this->url='https://weidian.cliu.cc/web/user'; } /** * Handle the event. * * @param TipSend $event * @return void */ public function handle(AuthRefundTip $event) { try{ $data=$event->data; $openid=$data['openid']; $config=config('wechat.official_account.daweiboshi'); $app = Factory::officialAccount($config); $app->template_message->send([ 'touser' => $openid, 'template_id' => $this->templateId, 'url' => $this->url, 'data' => $data['data'] ]); }catch (\Exception $exception){ Log::error('发送模板消息出错,出错内容为'.$exception); } } }