laravel-verify-new-email icon indicating copy to clipboard operation
laravel-verify-new-email copied to clipboard

Email is not sent

Open alex1897 opened this issue 3 years ago • 4 comments
trafficstars

I implemented the package on my local machine with sail. Everything seemed fine and I was able to receive the mails after changing the email address.

Once I uploaded it on my server, nothing happened after the email is changed. In the pending_user_emails table the entry with the new email is adde, but the mail is missing. No error message and nothing in the log.

First I thought mailing is not working at all, but the laravel Breeze emails are being sent out.

On my server I have PHP 8.1.5 and Laravel is on Version 9.2.

And idea what I should/can check to find the issue?

alex1897 avatar May 24 '22 20:05 alex1897

True. Vote +1

HayderThamer92 avatar Sep 17 '22 07:09 HayderThamer92

Any updates on this issue? I seem to be having this issue also, this was working OK on PHP7.4 and Laravel 7. But I updated to PHP8.1 with Laravel 8 and now the package seems not to be sending the new email verifications.

jimsawinner avatar Nov 28 '22 14:11 jimsawinner

For anyone that is having this issue I have found the cause (and potentially the solution). @alex1897 @HayderThamer92

The mailable class is implementing ShouldQueue which means the mail is being queued in the jobs table (check your database table jobs).

Which means the email will only send once the job has been dispatched - try running php artisan queue:work

Let me know if this helps

jimsawinner avatar Nov 28 '22 15:11 jimsawinner

To extend @jimsawinner answer. The mail is added to the queue ("jobs" table in db) and it's waiting for a worker to dispatch it. On local dev, you can use artisan queue:work command to start a worker manually, although you'll need to set up a supervisor service on your production server. More info can be found here https://laravel.com/docs/10.x/queues#supervisor-configuration.

Fradd747 avatar Jul 25 '23 14:07 Fradd747