Exemplo n.º 1
0
 /**
  * 
  * @param string $name
  * @return Message
  * @throws Exception
  */
 public function create($name)
 {
     if (!isset($this->config[$name])) {
         throw new Exception(__METHOD__ . ': message draft with name "' . $name . '" does not exists.');
     }
     $draft = new MessageDraft($this->config[$name]);
     $message = new Message($draft->getFrom(), $draft->getTo(), $draft->getSubject(), $draft->getBody(), $draft->getType());
     $message->setEncoding($draft->getEncoding());
     $message->setCc($this->applyEmails($draft->getCc()));
     $message->setBcc($this->applyEmails($draft->getBcc()));
     return $message;
 }