Get the HTML message body
764086
public function getHtmlMessageBody(ParserInterface $parser)
    {
        return $this->getMessageBody(
            $parser,
            $this->getHtmlMessage(),
            $this->getHtmlLayoutFileName(),
            $this->getHtmlTemplateFileName()
        );
    }
1161407
public function getProcessedBody()
    {
        $r = preg_split(MailImporter::getMessageBodyHashRegularExpression(), $this->body);
        $message = $r[0];
        $r = preg_replace(array(
            '/^On (.*) at (.*), (.*) wrote:/sm',
            '/[\n\r\s\>]*\Z/i',
        ), '', $message);

        return $r;
    }
1247242
public function getHtmlBody(){
        $bodies = $this->parent->getBodies();
        if (!isset($bodies['html'])) {
            return null;
        }

        return $bodies['html']->content;
    }
864276
def __get_html(self, body=None):
        

        output = []
        output.append("<html>")
        output.append("<head>")
        for javascript in (self.__jquery_javascript,
                           self.__crittercism_javascript,
                           self.__reporter_javascript):
            output.append("<script type=\"text/javascript\">")
            output.append(javascript)
            output.append("</script>")
        output.append("<style type=\"text/css\">")
        output.append(self.__style)
        output.append("</style>")
        output.append("</head>")
        if body is not None:
            output.append(body)
        else:
            output.append("<body>")
            output.append("<div id=\"report\">")
            output.append("</div>")
            output.append("</body>")
        output.append("</html>")
        return "\n".join(output)
919933
def html(body, status=200, headers=None):
    '''
    
    '''
    return HTTPResponse(body, status=status, headers=headers,
                        content_type='text/html; charset=utf-8')
1309350
def get_body(self, environ=None):
        """"""
        body = dict(
            status=self.code,
            message=self.get_description(environ),
        )

        if self.errors:
            body['errors'] = self.errors

        return json.dumps(body)
503489
public String getContentString(Message message)
    {
        try {
            String strContentType = message.getContentType();
            Object content = message.getContent();
            if (content instanceof MimeMultipart)
            {
                for (int index = 0; ; index++)
                {
                    BodyPart bodyPart = ((javax.mail.internet.MimeMultipart)content).getBodyPart(index);
                    Object contents = bodyPart.getContent();
                    if (contents != null)
                        return contents.toString();
                }
            }
            return message.getContent().toString();     // pend(don) FIX THIS!
        } catch (IOException ex)    {
            ex.printStackTrace();
        } catch (MessagingException ex)    {
            ex.printStackTrace();
        }
        return null;
    }
451832
public function getMessageBody()
    {
        $data = array(
            "registration_id" => $this->identifier,
            "collapse_key"    => $this->collapseKey,
            "data.message"    => $this->message,
        );
        if (!empty($this->data)) {
            $data = array_merge($data, $this->data);
        }

        return $data;
    }
624866
function createHtmlDocument (message) {
  var body = escapeHtml(message)
    .replace(NEWLINE_REGEXP, '<br>')
    .replace(DOUBLE_SPACE_REGEXP, ' &nbsp;')

  return '<!DOCTYPE html>\n' +
    '<html lang="en">\n' +
    '<head>\n' +
    '<meta charset="utf-8">\n' +
    '<title>Error</title>\n' +
    '</head>\n' +
    '<body>\n' +
    '<pre>' + body + '</pre>\n' +
    '</body>\n' +
    '</html>\n'
}
1069187
public function getHTMLBodyWithEmbeddedUrlImages($route_name, $params = []) {
        return $this->getCustomHTMLBody(function($body, $oAttachment) use($route_name, $params){
            /** @var \Webklex\IMAP\Attachment $oAttachment */
            if ($oAttachment->id && $oAttachment->getImgSrc() != null) {
                $oMessage = $oAttachment->getMessage();

                $image_url = route($route_name, array_merge([
                    'muid' => urlencode($oMessage->uid),
                    'mid' => urlencode($oMessage->message_id),
                    'mti' => urlencode($oMessage->date->timestamp),
                    'aid' => urlencode($oAttachment->id)
                ], $params));

                $body = str_replace('cid:'.$oAttachment->id, $image_url, $body);
            }

            return $body;
        });
    }
388265
function getAlertHtml(message) {
        var html = [];
        html.push('<div class="alert alert-danger alert-dismissible">');
        html.push('<button type="button" class="close" data-dismiss="alert">');
        html.push('<span>&times;</span>');
        html.push('</button>' + message);
        html.push('</div>');
        return html.join('');
    }
196634
def body(self, **kwargs):
        
        text_content, html_content = None, None
        if self.plain:
            text_content = mold.cast(self.plain, **kwargs)
        if self.html:
            html_content = mold.cast(self.html, **kwargs)
        return text_content, html_content
871263
def convert_msg_to_html(msg):
    """"""

    msg = re.sub("\n", "<br />", msg, flags=re.MULTILINE)
    return msg
258392
def get_message(self):
        """"""

        result = ''
        if self._data_struct is not None:
            result = self._data_struct[KEY_MESSAGE]
        return result
684636
def get_body_content(self):
        

        try:
            html_tree = parse_html_string(self.content)
        except:
            return ''

        html_root = html_tree.getroottree()

        if len(html_root.find('body')) != 0:
            body = html_tree.find('body')

            tree_str = etree.tostring(body, pretty_print=True, encoding='utf-8', xml_declaration=False)

            # this is so stupid
            if tree_str.startswith(six.b('<body>')):
                n = tree_str.rindex(six.b('</body>'))

                return tree_str[6:n]

            return tree_str

        return ''
720590
private String getFormAction(Message message) {
        return message.getHeader(HttpMessageHeaders.HTTP_REQUEST_URI) != null ? message.getHeader(HttpMessageHeaders.HTTP_REQUEST_URI).toString() : null;
    }
1072639
private Message buildMessage(String messageBody)
    throws MessagingException {
        Message message = new MimeMessage(getSession());
        message.setFrom(new InternetAddress(fromAddress));
        message.setSubject(substitute(subject));

        Multipart multiPart = new MimeMultipart();
        // html body part
        BodyPart bodyPart = new MimeBodyPart();
        if (messageBody == null)
            messageBody = getBody();
        bodyPart.setContent(messageBody, html ? "text/html" : "text/plain");
        multiPart.addBodyPart(bodyPart);
        // image body parts
        if (!images.isEmpty()) {
            for (String imageId : images.keySet()) {
                String imageFile = images.get(imageId);
                BodyPart imageBodyPart = new MimeBodyPart();
                DataSource imageDataSource = null;
                URL url = Thread.currentThread().getContextClassLoader().getResource(imageFile);
                if (url == null) {
                    final Asset imageAsset = AssetCache.getAsset(imageFile, "IMAGE_" + imageFile.substring(imageFile.lastIndexOf('.') + 1).toUpperCase());
                    if (imageAsset == null)
                        throw new MessagingException("Image not found: " + imageFile);
                    imageDataSource = new DataSource(){
                        public String getContentType() {
                            return imageAsset.getContentType();
                        }
                        public InputStream getInputStream() throws IOException {
                            byte[] bytes = imageAsset.getContent();
                            return new ByteArrayInputStream(bytes);
                        }
                        public String getName() {
                            return imageAsset.getName();
                        }
                        public OutputStream getOutputStream() throws IOException {
                            return null;
                        }
                    };
                }
                else {
                    // load from file
                    imageDataSource = new FileDataSource(getFilePath(url));
                }
                imageBodyPart.setDataHandler(new DataHandler(imageDataSource));
                imageBodyPart.setHeader("Content-ID","<" + imageId + ">");
                multiPart.addBodyPart(imageBodyPart);
            }
        }
        if (!attachments.isEmpty()) {
            for (String name : attachments.keySet()) {
                File file = attachments.get(name);
                BodyPart attachBodyPart = new MimeBodyPart();
                DataSource fds = new FileDataSource(file);
                attachBodyPart.setDataHandler(new DataHandler(fds));
                attachBodyPart.setFileName(name);
                multiPart.addBodyPart(attachBodyPart);
            }
        }
        message.setContent(multiPart);
        message.setSentDate(new Date());
        return message;
    }