8000 [Mailer][DX] Add notice log when email recipients are not defined by noniagriconomie · Pull Request #35818 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Mailer][DX] Add notice log when email recipients are not defined #35818

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

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Symfony/Component/Mailer/Transport/AbstractTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ public function send(RawMessage $message, Envelope $envelope = null): ?SentMessa
}

if (!$envelope->getRecipients()) {
$this->getLogger()->notice('There are no recipients in the mailer envelope. Nothing was sent.');
Copy link
Contributor
@jschaedl jschaedl Feb 21, 2020

Choose a reason for hiding this comment

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

I would have expected a LogicException and a hint about what I can do to fix the problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jschaedl i did not know the logic behind the « ?SentMessage » method return signature

that is why i added a log and not thrown ex and remove the return null

Maybe we need to wait other review comment :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

friendly ping @fabpot as you have commented on related issue #33753

Uh oh!

There was an error while loading. Please reload this page.


return null;
}

Expand Down
0