dimanche 4 décembre 2016

Laravel mail queue wrong mailgun domain

I m using Laravel 5.1 and for sending emails I use:

Mail::queue(XYZ, compact(ABC), function($message) use ($mailTo)
                {
                    $message->from(XXX, XXX);
                    $message->to(XXX)->subject(XXX);
                });

In the services.php I have:

'mailgun' => [
    'domain' => env('MAILGUN_DOMAIN'),
    'secret' => env('MAILGUN_SECRET'),
],

and everything works as expected.

However I had to change my Mailgun domain from sandboxXXXXXXXXXXXXX.mailgun.org to my.domain.com

and email are not delivered using the new domain unless I use Mail::send instead of Mail::queue. I also ran php artisan queue:restart, php artisan cache:clear and finally I restarted the supervisor on my server but it didn't work. In my log file I can see that using Mail::queue, Guzzle is still using the old domain while contacting Mailgun even if there is not any trace of the old domain in the code anymore.

Any suggestion?!

How can I fix this issue and be able to queue my emails using the new domain?

Thanks for your help!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire