laravel / framework

The Laravel Framework.
https://laravel.com
MIT License
32.62k stars 11.03k forks source link

Event listener fired after message sent Causes mailable failure if exception was thrown #53576

Closed mohamedds-12 closed 2 days ago

mohamedds-12 commented 2 days ago

Laravel Version

8

PHP Version

8

Database Driver & Version

8

Description

When I set a lister for the Laravel's MessageSent event, the logic in the listener gets executed with the mailable it's self therefore when an exception is thrown in the listener the mailable fails. This is unexpected knowing that the logic that would be handled after the email was sent is separate from the email sending logic. Reference : https://laravel.com/docs/8.x/mail#events

Steps To Reproduce

Set a mailable and define a listener for that event and throw an exception in the listener then queue a mailable, the mailable would fail cuz of the exception thrown in the listener Ref : https://laravel.com/docs/8.x/mail#events

crynobone commented 2 days ago

Hey there,

Unfortunately we don't support this version of the library anymore. Please check out our support policy on which versions we are currently supporting. Can you please try to upgrade to the latest version and see if your problem persists? If so, please open up a new issue and we'll help you out.

Thanks!