-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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.4] Always put Mailable on queue if ShouldQueue contract exists #18144
Conversation
Docs says: > If you have mailable classes that you want to always be queued, you may implement the `ShouldQueue` contract on the class. Now, even if you call the send method when mailing, the mailable will still be queued. With this change, even if I use the `send()` method, will be queued: ```php class OrderShipped extends Mailable implements ShouldQueue { use Queueable, SerializesModels; // todo } ``` Then: ```php Mail::send(new OrderShipped()); // Will be queued Mail::queue(new OrderShipped()); // Will be queued ```
@taylorotwell @KennedyTedesco Since you're putting a 'SendQueuedMailable' on the queue, which does
you're creating an endless loop that doesn't send anything.. |
@tomcoonen Have you tested? How can I reproduce this? Because I have tested on my app |
@KennedyTedesco I have tested this, keeps queuing.
|
@tomcoonen Got it. So, it's all good or we have any issue? |
@KennedyTedesco No good. Like I said, it keeps queuing without sending. |
@tomcoonen Now I see! I'll send a PR to fix this ASAP. |
Refs: #18144 This fixes the infinite recursion the was happening. I have tested on my local machine and looks good. @tomcoonen Can you have a look at this?
Refs: laravel/framework#18144 This fixes the infinite recursion the was happening. I have tested on my local machine and looks good. @tomcoonen Can you have a look at this?
Refs: laravel/framework#18144 This fixes the infinite recursion the was happening. I have tested on my local machine and looks good. @tomcoonen Can you have a look at this?
Documentation says:
With this change, even if I use the
send()
method, will be queued, because theShouldQueue
interface was implemented:Then:
@taylorotwell Is this makes sense for you?