/** * Create a new message instance. * * @return \Nova\Mail\Message */ protected function createMessage() { $message = new Message(new Swift_Message()); // If a global from address has been specified we will set it on every message // instances so the developer does not have to repeat themselves every time // they create a new message. We will just go ahead and push the address. if (isset($this->from['address'])) { $message->from($this->from['address'], $this->from['name']); } return $message; }
/** * Add the content to a given message. * * @param \Nova\Mail\Message $message * @param string $view * @param string $plain * @param array $data * @return void */ protected function addContent($message, $view, $plain, $data) { if (isset($view)) { $message->setBody($this->getView($view, $data), 'text/html'); } if (isset($plain)) { $message->addPart($this->getView($plain, $data), 'text/plain'); } }