Ejemplo n.º 1
0
 /**
  * Notify user via sending mail
  * 
  * @access public
  * @param array $mailArray
  * @throws \Exception Missing some required Mail option(s)
  */
 public function notify($mailArray)
 {
     $requiredKeys = array('from', 'to', 'subject', 'templateName', 'templateParameters');
     if (count(array_intersect_key(array_flip($requiredKeys), $mailArray)) !== count($requiredKeys)) {
         throw new \Exception("Missing some required Mail option(s)");
     }
     $mailViewModel = new ViewModel($mailArray['templateParameters']);
     $mailViewModel->setTemplate("notifications/mail/" . $mailArray['templateName']);
     $layout = new ViewModel();
     $layout->setTemplate("notifications/mail/layout");
     $layout->setVariable("emailBody", $this->viewRenderer->render($mailViewModel));
     $htmlMarkup = $this->viewRenderer->render($layout);
     $html = new MimePart($htmlMarkup);
     $html->type = "text/html";
     $body = new MimeMessage();
     $body->setParts(array($html));
     $mailArray["body"] = $body;
     $this->sendEmailJob->setContent($mailArray);
     $this->queue->push($this->sendEmailJob);
 }
Ejemplo n.º 2
0
 /**
  * @return Email
  */
 public function getContent()
 {
     return parent::getContent();
 }
Ejemplo n.º 3
0
 /**
  * @param Ticket $value
  * @return \Zend\Stdlib\Message
  */
 public function setContent($value)
 {
     return parent::setContent($value->getArrayCopy());
     // TODO: Change the autogenerated stub
 }