laravel 5.5 email notification not updating content laravel 5.5 email notification not updating content laravel laravel

laravel 5.5 email notification not updating content


This issue is not related to cache at all. When you run the queue worker all the notifications classes will be loaded once.

Any changes happen to these classes will not take effect as the worker already loaded the old classes.

You can read this at Laravel documentation:

Running Worker Section:

Remember, queue workers are long-lived processes and store the booted application state in memory. As a result, they will not notice changes in your code base after they have been started. So, during your deployment process, be sure to restart your queue workers.

Queue Workers & Deployment Section:

Since queue workers are long-lived processes, they will not pick up changes to your code without being restarted. So, the simplest way to deploy an application using queue workers is to restart the workers during your deployment process. You may gracefully restart all of the workers by issuing the queue:restart command.

So, to have your notification content updated, you have to kill all queue workers running and restart them.

This suggested solution (since you are using Supervisor) to restart Supervisor will work perfectly for you.

supervisorctl restart all

But, I do not recommend doing that as restarting Supervisor will hard-killing your queue workers and the current processed job will be lost!

Edit: Using Supervisor restart command is safe for Laravel 5.4+ but, make sure that to set "stopwaitsecs" (in your supervisor config file of the worker) to a value higher than the estimated job processing time.

That is why the artisan command to restart queue is exists:

php artisan queue:restart

You should be using this command to kill the queue workers and the Supervisor will get them started again for you.

But, keep in mind that this command will take some time until it takes effect as it will broadcast a restart signal to all the queue workers running and the queue workers will only capture the signal once it finishes processing their current job. That what is called graceful-killing.

To get this artisan command work, be sure to setup a proper cache driver for Laravel as the restart signal is broadcasted via cache.