公众号 之接入客服
一、效果图
二、代码
require_once \'../../../common.inc.php\'; require_once \'./wechat.class.php\'; //微信接口封装 $options = include_once "./config.php"; //app、secret等配置 $wx = new Wechat($options); $wx->getRev(); $wx->KFservice()->reply();
/** * 消息转发到客服 * $obj->KFservice()->reply(); * @return $this */ public function KFservice() { $msg = array( \'ToUserName\' => $this->getRevFrom(), \'FromUserName\' => $this->getRevTo(), \'MsgType\' => \'transfer_customer_service\', \'CreateTime\' => time() ); $this->Message($msg); return $this; }