diff --git a/src/Illuminate/Notifications/Messages/MailMessage.php b/src/Illuminate/Notifications/Messages/MailMessage.php index c13f4ef2cf35..2ee8cc2d26e3 100644 --- a/src/Illuminate/Notifications/Messages/MailMessage.php +++ b/src/Illuminate/Notifications/Messages/MailMessage.php @@ -3,9 +3,12 @@ namespace Illuminate\Notifications\Messages; use Traversable; +use Illuminate\Mail\Markdown; +use Illuminate\Container\Container; use Illuminate\Contracts\Support\Arrayable; +use Illuminate\Contracts\Support\Renderable; -class MailMessage extends SimpleMessage +class MailMessage extends SimpleMessage implements Renderable { /** * The view to be rendered. @@ -271,4 +274,16 @@ protected function arrayOfAddresses($address) $address instanceof Arrayable || $address instanceof Traversable; } + + /** + * Render the mail object into an HTML string. + * + * @return string + */ + public function render() + { + return Container::getInstance() + ->make(Markdown::class) + ->render($this->markdown, $this->data()); + } }