From 783bea8c4ff69f6ffa55183af166172786cbf79e Mon Sep 17 00:00:00 2001 From: Catalin Zmole Date: Mon, 23 Apr 2018 22:46:14 +0300 Subject: [PATCH 1/3] Render the right view when sending mails just in plain text format (#23822) --- src/Illuminate/Mail/Mailer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Mail/Mailer.php b/src/Illuminate/Mail/Mailer.php index a3d1c7ff2ac3..d8ceb88e6e60 100755 --- a/src/Illuminate/Mail/Mailer.php +++ b/src/Illuminate/Mail/Mailer.php @@ -201,7 +201,7 @@ public function render($view, array $data = []) $data['message'] = $this->createMessage(); - return $this->renderView($view, $data); + return $view ? $this->renderView($view, $data) : $this->renderView($plain, $data); } /** From e79989ab2018bb7aebb68902f645ed0bdc1cce22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Till=20Kr=C3=BCss?= Date: Tue, 24 Apr 2018 13:53:35 -0700 Subject: [PATCH 2/3] formatting --- src/Illuminate/Mail/Mailer.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Mail/Mailer.php b/src/Illuminate/Mail/Mailer.php index d8ceb88e6e60..b32c60669b13 100755 --- a/src/Illuminate/Mail/Mailer.php +++ b/src/Illuminate/Mail/Mailer.php @@ -201,7 +201,9 @@ public function render($view, array $data = []) $data['message'] = $this->createMessage(); - return $view ? $this->renderView($view, $data) : $this->renderView($plain, $data); + return $view + ? $this->renderView($view, $data) + : $this->renderView($plain, $data); } /** From 422fde3f0e270e5a5b574246f37e70c344ecae41 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Tue, 24 Apr 2018 21:55:35 +0100 Subject: [PATCH 3/3] Fixed code duplication --- src/Illuminate/Mail/Mailer.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Illuminate/Mail/Mailer.php b/src/Illuminate/Mail/Mailer.php index b32c60669b13..bc6373c31f87 100755 --- a/src/Illuminate/Mail/Mailer.php +++ b/src/Illuminate/Mail/Mailer.php @@ -201,9 +201,7 @@ public function render($view, array $data = []) $data['message'] = $this->createMessage(); - return $view - ? $this->renderView($view, $data) - : $this->renderView($plain, $data); + return $this->renderView($view ?: $plain, $data); } /**