getBody() public method

Returns NULL if no body has been set.
public getBody ( ) : string | null
return string | null
Beispiel #1
0
 /**
  * @param \Swift_Mime_MimeEntity $message
  *
  * @throws \TijsVerkoyen\CssToInlineStyles\Exception
  */
 private function convert(\Swift_Mime_MimeEntity $message)
 {
     if ($message->getContentType() !== 'text/plain') {
         $this->inliner->setCSS('');
         $this->inliner->setHTML($message->getBody());
         $message->setBody($this->inliner->convert());
     }
 }
 /**
  * Get a loggable string out of a Swiftmailer entity.
  *
  * @param  \Swift_Mime_MimeEntity $entity
  * @return string
  */
 protected function getMimeEntityString(\Swift_Mime_MimeEntity $entity)
 {
     $string = (string) $entity->getHeaders() . PHP_EOL . $entity->getBody();
     foreach ($entity->getChildren() as $children) {
         $string .= PHP_EOL . PHP_EOL . $this->getMimeEntityString($children);
     }
     return $string;
 }