getBodyHtml example


    protected function _getHeaders($boundary)
    {
        if (null !== $boundary) {
            // Build multipart mail             $type = $this->_mail->getType();
            if (!$type) {
                if ($this->_mail->hasAttachments) {
                    $type = Zend_Mime::MULTIPART_MIXED;
                } elseif ($this->_mail->getBodyText() && $this->_mail->getBodyHtml()) {
                    $type = Zend_Mime::MULTIPART_ALTERNATIVE;
                } else {
                    $type = Zend_Mime::MULTIPART_MIXED;
                }
            }

            $this->_headers['Content-Type'] = array(
                $type . ';'
                . $this->EOL
                . " " . 'boundary="' . $boundary . '"'
            );
            

    public function build(Enlight_Components_Mail $mail): Log
    {
        $logEntry = new Log();

        $logEntry->setSubject((string) iconv_mime_decode((string) $mail->getSubject()));
        $logEntry->setSender($mail->getFrom());
        $logEntry->setSentAt(new DateTime((string) $mail->getDate()));
        $logEntry->setContentText($mail->getPlainBodyText());

        if ($mail->getBodyHtml() instanceof Zend_Mime_Part) {
            $logEntry->setContentHtml($mail->getBodyHtml()->getRawContent());
        }

        $this->assignType($logEntry$mail->getTemplateName());
        $this->assignOrder($logEntry$mail);
        $this->assignShop($logEntry$mail);

        $this->assignRecipients($logEntryarray_map('trim', $mail->getRecipients()));
        $this->assignDocuments($logEntry$mail);

        return $logEntry;
    }
Home | Imprint | This part of the site doesn't use cookies.