Skip to content

Commit

Permalink
Rename setGlobalTo to setGlobalToAndRemoveCcAndBcc (#24917)
Browse files Browse the repository at this point in the history
It's really counter intuitive to have a setter destroy unrelated data,
best to be honest and complete about it.
  • Loading branch information
colindecarlo authored and taylorotwell committed Jul 21, 2018
1 parent 3bf6296 commit 10a8fbe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Illuminate/Mail/Mailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 10a8fbe

Please sign in to comment.