ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
sendTplNotice() - 发送模版消息 ### 说明 ``` sendTplNotice($touser, $template_id, $postdata, $url = '', $topcolor = '#FF683F') ``` ### 参数 - **$touser** string 粉丝openid - **$template_id** string 模板id - **$postdata** array() 根据模板规则完善消息 - **$url** string 详情页链接 - **$topcolor** string 模板内容字体颜色,不填默认为#FF683F ### 返回值 #### error 可用is_error判断,详见《错误处理》 #### success 返回boolean值:true ### 示例 ``` $data = array( 'first' => array( 'value' => "订单提交成功!", 'color' => '#ff510' ), 'keyword1' => array( 'value' => '1008', 'color' => '#ff510' ), 'keyword2' => array( 'value' => '2017-12-31-2018-01-01', 'color' => '#ff510' ), 'keyword3' => array( 'value' => '张三', 'color' => '#ff510' ), 'keyword4' => array( 'value' => '388元', 'color' => '#ff510' ), 'keyword5' => array( 'value' => '2017581543147', 'color' => '#ff510' ), 'remark' => array( 'value' => "欢迎您再次订购" , 'color' => '#ff510' ), ); $account_api = WeAccount::create(); $result = $account_api->sendTplNotice('oPUOlw7yvucjUrZhzG6gd8VdILa4', 'vJcJSes4vaVYv7sVEvOsRCGpZz8R3I4U1ODBbXcEBq8', $data); print_r($result); ```