/**
  * Construct message ready for formatting and transmission.
  *
  * @param Message $message
  *
  * @return array
  */
 protected function buildMessage(Message $message)
 {
     $msg = array('service' => str_replace(" ", "", $message->getFrom()['name']), 'message' => $message->getBody());
     if (null !== $this->getIcon()) {
         $msg['icon_url'] = $this->getIcon();
     }
     if (null !== $message->getIcon()) {
         $msg['icon_url'] = $message->getIcon();
     }
     return $msg;
 }
 /**
  * Construct message ready for formatting and transmission.
  *
  * @param Message $message
  *
  * @return array
  */
 protected function buildMessage(Message $message)
 {
     $msg = array('title' => $message->getFrom()['name'], 'message' => $message->getBody());
     if (null !== $this->getIcon()) {
         $msg['picture'] = $this->getIcon();
     }
     if (null !== $message->getIcon()) {
         $msg['picture'] = $message->getIcon();
     }
     return $msg;
 }
 /**
  * Construct message ready for formatting and transmission.
  *
  * @param Message $message
  *
  * @return array
  */
 protected function buildMessage(Message $message)
 {
     $msg = array('external_user_name' => str_replace(" ", "", $message->getFrom()['name']), 'content' => $message->getBody());
     $tags = $message->getTags();
     if (is_array($this->tags) && !empty($this->tags)) {
         $tags = array_merge($tags, $this->tags);
     }
     if (!empty($tags)) {
         $msg['tags'] = $tags;
     }
     return $msg;
 }
 /**
  * Construct message ready for formatting and transmission.
  *
  * @param Message $message
  *
  * @return array
  */
 protected function buildMessage(Message $message)
 {
     $msg = array('text' => $message->getBody(), 'username' => $message->getFrom()['name']);
     if (null !== $this->getIcon()) {
         $msg['icon_url'] = $this->getIcon();
     }
     if (null !== $message->getIcon()) {
         $msg['icon_url'] = $message->getIcon();
     }
     if (null !== $this->channel) {
         $msg['channel'] = $this->channel;
     }
     return $msg;
 }
 /**
  * Construct message ready for formatting and transmission.
  *
  * @param Message $message
  *
  * @return string
  */
 protected function buildMessage(Message $message)
 {
     $from = $message->getFrom();
     $content = $message->getBody();
     $tags = $message->getTags();
     $icon = $message->getIcon();
     $string = (string) "[MESSENGER] : A message has been sent." . PHP_EOL;
     $string .= "[MESSENGER][FROM] : {$from['name']}" . ($from['email'] != "" ? "[{$from['email']}]" : "") . PHP_EOL;
     $string .= "[MESSENGER][CONTENT] : {$content}";
     if (!empty($tags) && is_array($tags)) {
         $string .= PHP_EOL . "[MESSENGER][TAGS] : " . implode(", ", $tags);
     }
     if (!is_null($icon)) {
         $string .= PHP_EOL . "[MESSENGER][ICON] : " . $icon;
     }
     return $string;
 }
 /**
  * Construct message ready for formatting and transmission.
  *
  * @param Message $message
  *
  * @return string
  */
 protected function buildMessage(Message $message)
 {
     return "<message><type>TextMessage</type><body>{$message->getBody()}</body></message>";
 }
示例#7
0
 /**
  * Log that a message was sent.
  *
  * @param  Message  $message
  *
  * @return void
  */
 protected function logMessage(Message $message)
 {
     $this->logger->info("Pretending to send instant message: {$message->getBody()}");
 }
 /**
  * Construct message ready for formatting and transmission.
  *
  * @param Message $message
  *
  * @return array
  */
 protected function buildMessage(Message $message)
 {
     $msg = array('Body' => $message->getBody(), 'To' => $this->getTo(), 'From' => $this->getFrom());
     return $msg;
 }
 /**
  * Construct message ready for formatting and transmission.
  *
  * @param Message $message
  *
  * @return array
  */
 protected function buildMessage(Message $message)
 {
     return array('message' => array('sender_name' => $message->getFrom()['name'], 'text' => $message->getBody()));
 }
 /**
  * Construct message ready for formatting and transmission.
  *
  * @param Message $message
  *
  * @return array
  */
 protected function buildMessage(Message $message)
 {
     $msg = array('text' => $message->getBody(), 'chat_id' => $this->getChatId());
     return $msg;
 }
 /**
  * Construct message ready for formatting and transmission.
  *
  * @param Message $message
  *
  * @return array
  */
 protected function buildMessage(Message $message)
 {
     return array('message' => $message->getBody(), 'notify' => $this->notify, 'color' => $this->color);
 }
 /**
  * Construct message ready for formatting and transmission.
  *
  * @param Message $message
  *
  * @return array
  */
 protected function buildMessage(Message $message)
 {
     return array('text' => $message->getBody(), 'stream_id' => $this->stream);
 }