Returns the HtmlResponse with the form of PostBinding as content

@param SamlMessage $message

@return HtmlResponse
506690
public function getHttpPostBindingResponse(SamlMessage $message)
    {
        $bindingFactory = new BindingFactory();
        $postBinding = $bindingFactory->create(SamlConstants::BINDING_SAML2_HTTP_POST);

        $messageContext = new MessageContext();
        $messageContext->setMessage($message);

        $httpResponse = $postBinding->send($messageContext);

        return new HtmlResponse($httpResponse->getContent());
    }
1214652
public function outputHTML($message, $context = [])
    {
        $message = preg_replace_callback('/{([a-z0-9_-]+)}/i', function ($match) use ($context) {
            if (isset($context[$match[1]]) && is_string($context[$match[1]])) {
                return $context[$match[1]];
            }

            // don't change the original message
            return '{'.$match[1].'}';
        }, $message);

        $this->_output_bypass = true;
        $this->sse->send($this->js()->append($message.'<br/>'));
        $this->_output_bypass = false;

        return $this;
    }
436285
public function Message($Message) {
   
      // htmlspecialchars_decode is being used here to revert any specialchar escaping done by Gdn_Format::Text()
      // which, untreated, would result in &#039; in the message in place of single quotes.
   
      if ($this->PhpMailer->ContentType == 'text/html') {
         $TextVersion = FALSE;
         if (stristr($Message, '<!-- //TEXT VERSION FOLLOWS//')) {
            $EmailParts = explode('<!-- //TEXT VERSION FOLLOWS//', $Message);
            $TextVersion = array_pop($EmailParts);
            $Message = array_shift($EmailParts);
            $TextVersion = trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/s','',$TextVersion)));
            $Message = trim($Message);
         }
         
         $this->PhpMailer->MsgHTML(htmlspecialchars_decode($Message,ENT_QUOTES));
         if ($TextVersion !== FALSE && !empty($TextVersion)) {
            $TextVersion = html_entity_decode($TextVersion);
            $this->PhpMailer->AltBody = $TextVersion;
         }
      } else {
         $this->PhpMailer->Body = htmlspecialchars_decode($Message,ENT_QUOTES);
      }
      return $this;
   }
306573
public function html($content, $param = [], $config = [])
    {
        if ($param) {
            $content = strtr($content, $this->parseParam($param, $config));
        }
        $this->message->setBody($content, MailerConfig::CONTENT_HTML);

        return $this;
    }
1136734
public function massageMessageBody(array $message) {

    // @see: SwiftMailer::massageMessageBody()
    $line_endings = Settings::get('mail_line_endings', PHP_EOL);
    $message['body'] = Markup::create(implode($line_endings, array_map(function ($body) {
      // If the field contains no html tags we can assume newlines will need be
      // converted to <br>.
      if (strlen(strip_tags($body)) === strlen($body)) {
        $body = str_replace("\r", '', $body);
        $body = str_replace("\n", '<br>', $body);
      }
      return check_markup($body, 'full_html');
    }, $message['body'])));
    return $message;
  }
1085541
protected String createMessageHtml(CmsBroadcastMessage message) {

        StringBuffer result = new StringBuffer();
        result.append("<p class=\"").append(I_CmsLayoutBundle.INSTANCE.notificationCss().messageHead()).append("\">");
        if (!CmsStringUtil.isEmptyOrWhitespaceOnly(message.getIcon())) {
            result.append("<img src=\"").append(message.getIcon()).append("\">");
        }
        result.append("<em>" + message.getTime() + "</em><br/>");
        result.append(Messages.get().key(Messages.GUI_BROADCAST_SEND_BY_1, message.getUser()));
        result.append("</p>").append("<p>\n");
        result.append(
            message.getMessage().replaceAll("\\n", "<br/>").replaceAll("<div>", "<br>").replaceAll("</div>", ""));

        result.append("\n</p>");
        return result.toString();
    }
129766
public function kses( $message ) {
		return wp_kses(
			$message,
			array(
				'a'      => array(
					'href'   => true,
					'target' => true,
				),
				'strong' => true,
				'p'      => true,
				'ul'     => true,
				'li'     => true,
			)
		);
	}
800460
public function preparePayload(Message $message)
    {
        $payload = [
            'text' => $message->getText(),
            'channel' => $message->getChannel(),
            'username' => $message->getUsername(),
            'link_names' => $this->getLinkNames() ? 1 : 0,
            'unfurl_links' => $this->getUnfurlLinks(),
            'unfurl_media' => $this->getUnfurlMedia(),
            'mrkdwn' => $message->getAllowMarkdown(),
        ];

        if ($icon = $message->getIcon()) {
            $payload[$message->getIconType()] = $icon;
        }

        $payload['attachments'] = $this->getAttachmentsAsArrays($message);

        return $payload;
    }
703183
private function _prepareMessage($message)
    {
        if (is_string($message) || is_numeric($message)) {
            return $message;
        }
        
        if (is_array($message)) {
            return json_encode($message, JSON_UNESCAPED_UNICODE);
        }
        
        return null;
    }
1169156
public function jsonSuccess($data = null, $message = null) {
        if (!is_array($message)) {
            $message = ['messages' => $message];
        }
        if ($data instanceof ArrayAble) {
            $data = $data->toArray();
        }
        return $this->json(array_merge(array(
            'code' => 200,
            'status' => __('success'),
            'data' => $data
        ), $message));
    }
1031998
protected function getJsonPayload($message)
    {
        if (is_array($message) || $message instanceof JsonSerializable) {
            return json_encode($message);
        } elseif (method_exists($message, 'toJson')) {
            return $message->toJson();
        } elseif (method_exists($message, 'toArray')) {
            return json_encode($message->toArray());
        } elseif (is_string($message) && is_array(json_decode($message, true))) {
            return $message;
        }
    }
104569
protected function buildView($message)
    {
        if ($message->view) {
            return $message->view;
        }

        return [
            'html' => $this->markdown->render($message->markdown, $message->data()),
            'text' => $this->markdown->renderText($message->markdown, $message->data()),
        ];
    }
1153075
public function getMailjetMessage(Swift_Mime_Message $message) {
        $contentType = $this->getMessagePrimaryContentType($message);
        $fromAddresses = $message->getFrom();
        $fromEmails = array_keys($fromAddresses);
        $attachments = array();
        $inline_attachments = array();
        // Process Headers
        $customHeaders = $this->prepareHeaders($message, $this->getMailjetHeaders());
        $userDefinedHeaders = $this->findUserDefinedHeaders($message);
        if ($replyTo = $this->getReplyTo($message)) {
            $userDefinedHeaders = array_merge($userDefinedHeaders, array('Reply-To' => $replyTo));
        }

        // Handle content
        $bodyHtml = $bodyText = null;
        if ($contentType === 'text/plain') {
            $bodyText = $message->getBody();
        } else {
            $bodyHtml = $message->getBody();
        }

        // Handle attachments
        foreach ($message->getChildren() as $child) {
            if ($child instanceof Swift_Attachment) {
                //Handle regular attachments
                if ($child->getDisposition() === "attachment") {
                    $attachments[] = array(
                        'Content-type' => $child->getContentType(),
                        'Filename' => $child->getFilename(),
                        'content' => base64_encode($child->getBody())
                    );
                }
                //Handle inline attachments
                elseif ($child->getDisposition() === "inline") {
                    $inline_attachments[] = array(
                        'Content-type' => $child->getContentType(),
                        'Filename' => $child->getFilename(),
                        'content' => base64_encode($child->getBody())
                    );
                }
            } elseif ($child instanceof Swift_MimePart && $this->supportsContentType($child->getContentType())) {
                if ($child->getContentType() == "text/html") {
                    $bodyHtml = $child->getBody();
                } elseif ($child->getContentType() == "text/plain") {
                    $bodyText = $child->getBody();
                }
            }
        }
        $mailjetMessage = array();
        $recipients = $this->getRecipients($message);
        if (count($recipients) > 0) {
            $mailjetMessage['Recipients'] = $recipients;
        }
        if (!is_null($fromEmails[0])) {
            $mailjetMessage['FromEmail'] = $fromEmails[0];
        }
        if (!is_null($message->getSubject())) {
            $mailjetMessage['Subject'] = $message->getSubject();
        }
        if (!is_null($fromAddresses[$fromEmails[0]])) {
            $mailjetMessage['FromName'] = $fromAddresses[$fromEmails[0]];
        }
        if (!is_null($bodyHtml)) {
            $mailjetMessage['Html-part'] = $bodyHtml;
        }
        if (!is_null($bodyText)) {
            $mailjetMessage['Text-part'] = $bodyText;
        }
        if (count($userDefinedHeaders) > 0) {
            $mailjetMessage['Headers'] = $userDefinedHeaders;
        }
        if (count($customHeaders) > 0) {
            $mailjetMessage = array_merge($mailjetMessage, $customHeaders);
        }
        if (count($attachments) > 0) {
            $mailjetMessage['Attachments'] = $attachments;
        }
        if (count($inline_attachments) > 0) {
            $mailjetMessage['Inline_attachments'] = $inline_attachments;
        }

        // @TODO bulk messages
        return $mailjetMessage;
    }
633074
protected function badRequest(string $message = 'Bad request.'): Response
    {
        return $this->getResponse()
            ->setContent($message)
            ->setStatusCode(Response::HTTP_BAD_REQUEST);
    }
125597
public function sendMessage(Message $message)
    {
        $this->currentId++;
        $messageData = $message->convertToRconData($this->currentId);
        $this->client->write($messageData);

        return $this->getResponseMessage();
    }
232343
public function respondCreated($message = "Created")
    {
        $reponse = $this->setStatusCode(ResponseHTTP::HTTP_CREATED)
            ->respondWithMessage($message);
        return $reponse;
    }
37059
private static function resolveBodyHtmlFromApiMessage(\Google_Service_Gmail_Message $gmailApiMessage)
    {
        /** @var \Google_Service_Gmail_MessagePart $payload */
        $payload = $gmailApiMessage->getPayload();

        if ($partsBody = static::getBodyFromParts($payload->getParts(), 'text/html')) {
            return $partsBody;
        }

        if ($payload->getBody() instanceof \Google_Service_Gmail_MessagePartBody) {
            return static::bodyToText($payload->getBody());
        }

        return;
    }