-
Notifications
You must be signed in to change notification settings - Fork 46
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
Make queueing error mails configureable #32
Conversation
@codegain Thanks for the PR but still don't think it will resolve the issue #31 . The new flow will be like
Your input on this? |
I think the problem of #31 is that an exception is thrown inside the laravel mailer where the smtp connection is established if a worker sends out the error mail. In the current version, the Mailable "ExceptionMailer" implements the interface "ShouldQueue" which will always queue the mail, even if it is sent via The process is as follows: Sneaker.php Mailer.php (Illuminate):
which calls:
which currently always results in the mailable being queued if a queue is available. Therefore, none of the currently implemented try-catch blocks will catch any exception because the mail is successfully pushed onto the queue. The worker will then execute the queued mail via the "SendQueuedMailable" job class:
which results in a call to ExceptionMailer->send() which is not overwritten and therefore the following code gets executed:
It is this
From my perspective, there are two options:
@akaamitgupta I think option 2 is a good way to deal with this problem and I can submit another PR if you want. |
This PR (idea from #31) adds a new configuration option "should_queue" in the sneaker.php configuration file which determines if the error mail should be sent via the queue or not.