Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.6] Rename setGlobalTo to setGlobalToAndRemoveCcAndBcc #24917

Merged
merged 1 commit into from
Jul 21, 2018

Conversation

colindecarlo
Copy link
Contributor

I spent a bunch of time earlier tonight trying to figure out why the cc addressee I was setting in my Mailable wasn't receiving a copy of the email I was sending. Turns out the setGlobalTo method in the Mailer removes the cc and bcc recipients.

This change may prevent future devs from banging their heads against this.

It's really counter intuitive to have a setter destroy unrelated data,
best to be honest and complete about it.
@devcircus
Copy link
Contributor

If I'm remembering correctly, this has been discussed before. The global "to" address exists jug for development for the purpose of replacing any recipients, so that emails don't get sent to someone accidentally while developing. IMO, the current behavior is correct. On the other hand, other devs have mentioned this before, so I guess there's room for discussion. I'll try to find the old issue /pr related to this.

@colindecarlo
Copy link
Contributor Author

Ha, this PR was a little tongue in cheek, no real motivation other than to work out my own frustration for banging up against this.

The documentation does a pretty good job of saying that the 'Universal To' is meant for local development.

I was using it in a "real" app I made for a family member that sends one email as a sort of 'contact us' submission.

With that said, the method name is certainly more accurate now :)

@taylorotwell taylorotwell merged commit 10a8fbe into laravel:5.6 Jul 21, 2018
@GrahamCampbell GrahamCampbell changed the title Rename setGlobalTo to setGlobalToAndRemoveCcAndBcc [5.6] Rename setGlobalTo to setGlobalToAndRemoveCcAndBcc Jul 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants