From 10a8fbe742da6fdc3b0778db6f9d33c8d41602fb Mon Sep 17 00:00:00 2001 From: Colin DeCarlo Date: Sat, 21 Jul 2018 11:46:09 -0400 Subject: [PATCH] Rename `setGlobalTo` to `setGlobalToAndRemoveCcAndBcc` (#24917) It's really counter intuitive to have a setter destroy unrelated data, best to be honest and complete about it. --- src/Illuminate/Mail/Mailer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Mail/Mailer.php b/src/Illuminate/Mail/Mailer.php index bc6373c31f87..d610f47af11d 100755 --- a/src/Illuminate/Mail/Mailer.php +++ b/src/Illuminate/Mail/Mailer.php @@ -236,7 +236,7 @@ public function send($view, array $data = [], $callback = null) // message. This is primarily useful during local development in which each // message should be delivered into a single mail address for inspection. if (isset($this->to['address'])) { - $this->setGlobalTo($message); + $this->setGlobalToAndRemoveCcAndBcc($message); } // Next we will determine if the message should be sent. We give the developer @@ -347,7 +347,7 @@ protected function renderView($view, $data) * @param \Illuminate\Mail\Message $message * @return void */ - protected function setGlobalTo($message) + protected function setGlobalToAndRemoveCcAndBcc($message) { $message->to($this->to['address'], $this->to['name'], true); $message->cc(null, null, true);