/**
  * @param Email  $email
  * @param \Exception $previous
  */
 public function __construct(Email $email, \Exception $previous = null)
 {
     $message = sprintf('Cannot load a body for "%s" email.', $email->getSubject());
     if ($previous) {
         $message .= sprintf(' Reason: %s.', $previous->getMessage());
     }
     parent::__construct($message, 0, $previous);
 }
 /**
  * @param Email $email
  */
 public function __construct(Email $email)
 {
     parent::__construct(sprintf('Cannot find a body for "%s" email.', $email->getSubject()));
 }
Example #3
0
 /**
  * @param EmailEntity $parentEmailEntity
  *
  * @return EmailModel
  */
 public function createForwardEmailModel(EmailEntity $parentEmailEntity)
 {
     $emailModel = $this->factory->getEmail();
     $emailModel->setMailType(EmailModel::MAIL_TYPE_FORWARD);
     $emailModel->setParentEmailId($parentEmailEntity->getId());
     $emailModel->setSubject($this->helper->prependWith('Fwd: ', $parentEmailEntity->getSubject()));
     $body = $this->helper->getEmailBody($parentEmailEntity, 'OroEmailBundle:Email/Forward:parentBody.html.twig');
     $emailModel->setBodyFooter($body);
     // link attachments of forwarded email to current email instance
     if ($this->request->isMethod('GET')) {
         $this->applyAttachments($emailModel, $parentEmailEntity);
     }
     return $this->createEmailModel($emailModel);
 }
Example #4
0
 public function testSubjectGetterAndSetter()
 {
     $entity = new Email();
     $entity->setSubject('test');
     $this->assertEquals('test', $entity->getSubject());
 }