From ad2eaf72d7fc003a98215d4a373ea603658c646a Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 1 Jun 2017 07:59:57 -0500 Subject: [PATCH] formatting --- src/Illuminate/Mail/Mailable.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Mail/Mailable.php b/src/Illuminate/Mail/Mailable.php index 6f7d02c4d5db..074768c37368 100644 --- a/src/Illuminate/Mail/Mailable.php +++ b/src/Illuminate/Mail/Mailable.php @@ -192,7 +192,7 @@ protected function buildMarkdownView() return [ 'html' => $markdown->render($this->markdown, $data), - 'text' => isset($this->textView) ? $this->textView : $markdown->renderText($this->markdown, $data), + 'text' => $this->buildMarkdownText(), ]; } @@ -214,6 +214,18 @@ public function buildViewData() return $data; } + /** + * Build the text view for a Markdown message. + * + * @return string + */ + protected function buildMarkdownText() + { + return isset($this->textView) + ? $this->textView + : $markdown->renderText($this->markdown, $data); + } + /** * Add the sender to the message. *