/** * 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); }
/** * @return Email */ public function getContent() { return parent::getContent(); }
/** * @param Ticket $value * @return \Zend\Stdlib\Message */ public function setContent($value) { return parent::setContent($value->getArrayCopy()); // TODO: Change the autogenerated stub }