微擎receiver.php关注事件

class Delete_gjzhbModuleReceiver extends WeModuleReceiver {
public function receive() {
$type = $this->message['type'];//类型
$event = $this->message['event'];
if (($event == 'subscribe') && ($type == 'subscribe'))//判断
{
$custom = array(
    'msgtype' => 'text',
    'text' => array('content' => urlencode('欢迎关注')),
    'touser' => $this->message['from'],
);


$account_api = WeAccount::create();//实例化
$result = $account_api->sendCustomNotice($custom);//调用微擎接口
// print_r($result);
}



}

}

你可能感兴趣的:(微擎,微信,PHP)