/** * 发送消息 * * @param string $openId * * @return bool */ public function to($openId) { if (empty($this->message)) { throw new Exception('未设置要发送的消息'); } $this->message->to = $openId; return $this->http->jsonPost(self::API_MESSAGE_SEND, $this->message->buildForStaff()); }
/** * 发送消息 * * @param string $openId * * @return boolean */ public function to($openId) { if (empty($this->message)) { throw new Exception("未设置要发送的消息"); } $this->message->to = $openId; Wechat::request('POST', self::API_MESSAGE_SEND, $this->message->buildForStaff()); return true; }
/** * 发送消息 * * @param string $openId * * @return bool */ public function totag($tagid, $agentid = 1) { if (empty($this->message)) { throw new Exception('未设置要发送的消息'); } $this->message->totag = $tagid; $this->message->agentid = $agentid; $message_body = $this->message->buildForStaff(); return $this->http->jsonPost(self::API_MESSAGE_SEND, $message_body); }