模板消息

发送模板消息

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

实例:

$data = [
    'touser' => 'onqj0jvFNLRI_3H-C0L9n9lKYuKU',
    'template_id' => 'KfzWtC8N0b6bkfXCpqUzLQ21h-xTfD7LQkgceyvQChU',
    'url' => 'https://wii.qq.com',
    'data' => [
        'first' => [
            'value' => '我们已收到您的货款,开始为您打包商品,请耐心等待: )',
            'color' => '#000000'
        ],
        'orderMoneySum' => [
            'value' => '30.00元',
            'color' => '#FF0000'
        ],
        'orderProductName' => [
            'value' => '我是商品名字',
            'color' => '#00FF00'
        ],
        'Remark' => [
            'value' => '如有问题请致电400-828-1878或直接在微信留言,小易将第一时间为您服务!',
            'color' => '#0000FF'
        ]
    ]
];

$result = \Wii::app()->wxPubAccount->getTemplateMessage()->sendTemplateMessage($data);

results matching ""

    No results matching ""