7 months ago

Replacing SendQueuedMailable

Posted 7 months ago by chilitomato

Recently moving to queues for sending mail, I found that by making my mailables simply implement ShouldQueue, no modification need to be made to all the mail send calls (great).

However, I would also like to implement throttling for the mail send jobs. It seems in a custom Job i can use the Redis fascade in the handle() method to implement this quite cleanly and easily. The problem is, mailables queued via the send behavior that detects ShouldQueue are coupled to the SendQueuedMailable Job in the framework.

Is there a way to either A) specify a different job class to be used in this behavior or B) inject my own SendQueuedMailable replacement via some IoC mechanism?

Please sign in or create an account to participate in this conversation.