diff --git a/src/Illuminate/Notifications/Channels/MailChannel.php b/src/Illuminate/Notifications/Channels/MailChannel.php index df8d86634c3..e37931cf0f8 100644 --- a/src/Illuminate/Notifications/Channels/MailChannel.php +++ b/src/Illuminate/Notifications/Channels/MailChannel.php @@ -93,6 +93,10 @@ protected function buildView($message) return $message->view; } + if (property_exists($message, 'theme') && ! is_null($message->theme)) { + $this->markdown->theme($message->theme); + } + return [ 'html' => $this->markdown->render($message->markdown, $message->data()), 'text' => $this->markdown->renderText($message->markdown, $message->data()), diff --git a/src/Illuminate/Notifications/Messages/MailMessage.php b/src/Illuminate/Notifications/Messages/MailMessage.php index dd91420afaa..7ae89c6a181 100644 --- a/src/Illuminate/Notifications/Messages/MailMessage.php +++ b/src/Illuminate/Notifications/Messages/MailMessage.php @@ -31,6 +31,13 @@ class MailMessage extends SimpleMessage implements Renderable */ public $markdown = 'notifications::email'; + /** + * The current theme being used when generating emails. + * + * @var string|null + */ + public $theme = 'default'; + /** * The "from" information for the message. * @@ -134,6 +141,19 @@ public function template($template) return $this; } + /** + * Set the theme to use with the markdown template. + * + * @param string $theme + * @return $this + */ + public function theme($theme) + { + $this->theme = $theme; + + return $this; + } + /** * Set the from address for the mail message. *