如何用php实现发送微信模板消息呢?
众所周知,现在微信公众号现在越来越火,微信公众号对的模板消息公众号用来向微信用户发送重要的通知的功能,下面小编就给大家介绍一下php
实现发送微信模板消息的方法。
如何用php 实现发送微信模板消息呢?
namespace Org\Weixin;
/**
* Created by PhpStorm.
* User: StandOpen
* Date: 15-1-7
* Time: 9:41
*/
class OrderPush
{
protected $appid;
protected $secrect;
protected $accessToken;
function __construct($appid, $secrect)
{
$this->appid = $appid;
$this->secrect = $secrect;
$this->accessToken = $this->getToken($appid, $secrect);
}
/**
* 发送post请求
* @param string $url
* @param string $param
* @return bool|mixed
*/
function request_post($url = '', $param = '')
{
if (empty($