예제 #1
0
파일: Email.php 프로젝트: xamin123/platform
 /**
  * Get email body
  *
  * @return EmailBody
  */
 public function getBody()
 {
     if ($this->body === null) {
         $this->body = new EmailBody();
         $body = $this->message->getBody();
         try {
             $this->body->setContent($body->getContent(Body::FORMAT_HTML)->getDecodedContent());
             $this->body->setBodyIsText(false);
         } catch (InvalidBodyFormatException $ex) {
             $this->body->setContent($body->getContent(Body::FORMAT_TEXT)->getDecodedContent());
             $this->body->setBodyIsText(true);
         }
     }
     return $this->body;
 }
예제 #2
0
파일: Email.php 프로젝트: Maksold/platform
 /**
  * Get email body
  *
  * @return EmailBody
  */
 public function getBody()
 {
     if ($this->body === null) {
         $this->body = new EmailBody();
         $body = $this->message->getBody();
         $contentType = $this->message->getPriorContentType();
         if ($contentType && strtolower($contentType->getType()) === 'text/html') {
             $this->body->setContent($body->getContent(Body::FORMAT_HTML)->getDecodedContent());
             $this->body->setBodyIsText(false);
         } else {
             $this->body->setContent($body->getContent(Body::FORMAT_TEXT)->getDecodedContent());
             $this->body->setBodyIsText(true);
         }
     }
     return $this->body;
 }