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

[9.x ] Updated Mailable to prevent duplicated recipients #45119

Merged
merged 5 commits into from Nov 28, 2022

Conversation

WendellAdriel
Copy link
Contributor

As discussed on #45042 these changes prevent the use of duplicated recipients in the to, from, cc, bcc and replyTo properties of the mailable.

Copy link
Member

@driesvints driesvints left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks okay to me. At least worth a try.

@driesvints driesvints linked an issue Nov 28, 2022 that may be closed by this pull request
@WendellAdriel
Copy link
Contributor Author

Thank you so much @driesvints!!!

@taylorotwell
Copy link
Member

But now these tests no longer check that two "to" addresses can actually be added.

@taylorotwell taylorotwell marked this pull request as draft November 28, 2022 14:30
@WendellAdriel
Copy link
Contributor Author

That’s true @taylorotwell, sorry!
I’ll update the tests and the PR ASAP

@WendellAdriel WendellAdriel marked this pull request as ready for review November 28, 2022 15:22
@taylorotwell taylorotwell merged commit defd920 into laravel:9.x Nov 28, 2022
@AAllport
Copy link
Contributor

AAllport commented Jan 31, 2023

It looks like this may have introduced a bug/breaking change...

If you have the following: Mail::to($recipient)->send(new FooMail($recipient))
You can no longer set the "name" of the recipient in the build method when calling ->to($reciepent->mail, $recipient->full_name)

It looks like the call to ->unique() is removing the instance of the address with the name.

Was this intended behaviour?
It feels like if you are calling ->to(), then the most recent addition should take priority.

Suggested fix in #45885

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.

Duplicate replyTo when running render() prior to send
4 participants