Laravel 5.7 No Verification Email sent
Asked Answered
E

1

0

When I register a user, or click 'click here to request another', no verification mail is sent, although it answers with 'A fresh verification link has been sent to your email address. ' . I checked my .env and config/mail.php file and successfully tested them with tinker and Mail::Send(...). I also followed the laravel documentation and tried some solutions, which were discussed here on StackOverflow.

  • My User extends Authenticatable, implements MustVerifyEmail and uses Notifiable
  • My 'RegisterController' explicitly calls $user->sendEmailVerificationNotification() in the create function
  • Added Auth::routes(['verify' => true]); to web.php

I assume, that there is something wrong with the standard sendEmailVerificationNotification implementation, but I am too new to Laravel to figure out what's the problem.

Thanks for your help!

Effuse answered 20/2, 2019 at 9:57 Comment(4)
In web.php, add this parameter for auth routes............. // for email verification. Auth::routes(['verify' => true]);Hemistich
Have you configured the Queue system? look here for notifications: laravel.com/docs/5.7/notificationsKelleher
@InzamamIdrees Yes, I got this already.Effuse
@Kelleher This seems important, if you want to manually send mails in combination with notifying. But is it relevant for the standard Auth implementation? If yes, how?Effuse
E
0

I found my mistake:

I swapped out the User with my own user class. The column name of the mail address is mail_address, which differs from the default column name. Therefore I added this override to my User:

public function routeNotificationForMail($notification) { return $this->email_address; }

Effuse answered 20/2, 2019 at 11:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.