Skip to content
Advertisement

image not displaying in mail in queue – laravel

In my mail template I used image path as below :

JavaScript

It is working with normal mail (without the queue) but not in mail in queue.

By inspecting element in mail i found that when for normal mail image path is as below :

JavaScript

But for mail queue it is :

JavaScript

Advertisement

Answer

You have to set a URL for your application for the Console commands to know what URL to use for your application for URL generation as there is no webserver passing the request information to it.

You can set APP_URL in your .env file for this.

JavaScript

By default it is set to http://localhost, which is why that is showing up.

If your configuration is cached you will need to clear it or cache it again:

JavaScript

You will need to stop the queue workers most likely, (command to make the queue workers die after processing any current jobs):

JavaScript

Then you can start them up again, or hopefully you have something monitoring those processes and will restart them after they die.

Laravel 6.x Docs – Configuration – Configuration Caching

Laravel 6.x Docs – Queues – Queue Workers & Deployment

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement