GetcharZp

微擎发送模板消息

参考链接

$openid = \'oXo3is-YksITdG35n4tTKBKog\';
// “未处理消息提醒”消息模板
$tpl_id=\'G0_VQBsYx_iJKKkb3vj3_Y4D4mPPEyEYpmzT9rLT3b0\';
//跳转链接
$url=\'http://www.baidu.com\';
//消息数据
$postdata = array(
    \'first\' => array(
        \'value\' => \'测试\',
        \'color\' => \'#FF3030\'
    ),
    \'keyword1\'=>[\'value\'=>\'猫猫虫\'], // 客户姓名
    \'keyword2\'=>[\'value\'=>date(\'Y-m-d H:i:s\',$_W[\'timestamp\'])], // 量尺时间
    \'remark\'=>array(
        \'value\'=>
            \'申请时间:\'.date(\'Y-m-d H:i:s\',$_W[\'timestamp\'])
    ),

);
//发送消息给客户
load()->classs( \'weixin.account\' );
$account=WeAccount::create();
$result = $account->sendTplNotice($openid, $tpl_id, $postdata, $url, $topcolor = \'#FF683F\');
message(json_encode($result, JSON_UNESCAPED_UNICODE));

 

 

分类:

技术点:

相关文章: