Esempio n. 1
0
 public function send($subject, $messageBody)
 {
     if (empty($subject)) {
         throw new \InvalidArgumentException("subject may not be empty");
     }
     $subject = sprintf("[%s] %s", substr(strtoupper(\Whathood\Util::environment()), 0, 4), $subject);
     $html = new \Zend\Mime\Part(nl2br($messageBody));
     $html->type = 'text/html';
     $body = new \Zend\Mime\Message();
     $body->setParts(array($html));
     $message = new Message();
     $message->addFrom($this->fromAddress, $this->fromName)->addTo($this->toAddress)->setSubject($subject);
     $message->setBody($body);
     $transport = $this->getTransport();
     if (\Whathood\Util::is_production()) {
         $transport->send($message);
     }
 }