-
I have two mailable clasess: Notification and UserRegister
-
On develop environment both work fine
-
On production environment only Notification works properly.
-
In this case, UserRegister works if it’s sent directly but not when queued. It tries till 255 attempts are reached and then it stops.
Mail::to($address)->send(new UserRegister($user)); // works fine Mail::to($address)->queue(new UserRegister($user)); //it doesn*t work. Always on queue Mail::to($address)->later($when,new UserRegister($user)); //it doesn*t work. Always on queue
-
I have cleared all caches in production. I have executed "composer dump-autoload".
-
My .env parameter for queue is database on both environments:
QUEUE_DRIVER=database
- I have restarted the production server
- There could be something wrong on my supervisor configuration?
- No idea what else I should do
Thanks for any help
3
Answers
Please verify the below task and try again
If you need more information about the queue then please go to "https://laravel.com/docs/10.x/queues#main-content".
ISSUE AND SOLUTION IS IN SUPERVISOR!!. The problem is solved. I was using queue:work to run my queue. Running the queue with queue:listen solved the issue.