Files
kiri-wchat/wx/Template.php
T

30 lines
666 B
PHP
Raw Normal View History

2018-07-19 12:10:22 +08:00
<?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);
2018-07-19 18:48:36 +08:00
return Http::post($url, $postBody, NULL, ['content-type' => 'application/json'])
2018-07-19 12:10:22 +08:00
->append('postBody', $postBody);
}
}