Files
kiri-wchat/wx/Template.php
T
as2252258@163.com c4b43deb9f add clear
2019-07-12 18:51:12 +08:00

31 lines
671 B
PHP

<?php
/**
* Created by PhpStorm.
* User: whwyy
* Date: 2018/4/8 0008
* Time: 9:49
*/
namespace wchat;
class Template extends Base
{
/**
* @param $openId
* @param $message
* @param $form_id
* @return Result
* @throws \Exception
*
* 奴隶交易通知
*/
public function sendTemplate(string $access,array $postBody)
{
$url = 'https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send?access_token=' . $access;
$postBody = json_encode($postBody);
return WxClient::post($url, $postBody, NULL, ['content-type' => 'application/json'])
->append('postBody', $postBody);
}
}