protected function addBodies(\Swift_Message $message, MailRenderedInterface $mailRendered): void
    {
        $textPlain = $mailRendered->getBody();
        $html = $mailRendered->getHtmlBody();

        if (null === $html) {
            $message->setBody($textPlain, 'text/plain');

            return;
        }

        $message->setBody($html, 'text/html');

        if (null !== $textPlain) {
            $message->addPart($textPlain, 'text/plain');
        }
    }
protected function addBodies(\Swift_Message $message, MailRenderedInterface $mailRendered): void
    {
        $textPlain = $mailRendered->getBody();
        $html = $mailRendered->getHtmlBody();

        if (null === $html) {
            $message->setBody($textPlain, 'text/plain');

            return;
        }

        $message->setBody($html, 'text/html');

        if (null !== $textPlain) {
            $message->addPart($textPlain, 'text/plain');
        }
    }
protected function addBodies ( \ Swift_Message $ message , MailRenderedInterface $ mailRendered ) : void { $ textPlain = $ mailRendered -> getBody ( ) ; $ html = $ mailRendered -> getHtmlBody ( ) ; if ( null === $ html ) { $ message -> setBody ( $ textPlain , 'text/plain' ) ; return ; } $ message -> setBody ( $ html , 'text/html' ) ; if ( null !== $ textPlain ) { $ message -> addPart ( $ textPlain , 'text/plain' ) ; } }
Add html and plain text bodies or only plain text if html is empty.

@param \Swift_Message        $message      The swiftmailer message
@param MailRenderedInterface $mailRendered The rendered mail
Add html and plain text bodies or only plain text if html is empty .