模板消息

发送模板消息

WxApp::getTemplateMessage()->sendTemplateMessage($data);

实例:

$formId = $this->request->get('form_id');

$data = [
    'touser' => 'og6Yd0Rj3KgMGcspe--eZwRe6sOY',
    'template_id' => '8bc10UZAFPmnz-5w4x5i5FkqbcrU_6uUC5sDKEOrM4k',
    'form_id' => $formId,
    'data' => [
        'keyword1' => [
            'value' => '开会讨论小程序开发',
//                    'color' => '#000000'
        ],
        'keyword2' => [
            'value' => '2016年10月10日 9:00-12:00',
//                    'color' => '#FF0000'
        ],
        'keyword3' => [
            'value' => '第二会议室',
//                    'color' => '#00FF00'
        ],
        'keyword4' => [
            'value' => '5人接受;3人待定',
//                    'color' => '#0000FF'
        ]
    ]
];

$result = \Wii::app()->wxApp->getTemplateMessage()->sendWxAppTemplateMessage($data);

results matching ""

    No results matching ""