You can probably just copy over the code from the verification mail feature from Laravel.
I would probably extend this class or copy-paste it ;)
There are two ways to add new users to my app: One via registration, and one after registration when an admin adds users to his account. So I wanted to create a custom verification notification for when an admin adds a user to his accout. (And then be able to choose which email format to send)
At first I override the sendEmailVerificationNotification method:
public function sendEmailVerificationNotification()
{
$this->notify(new Notifications\customUserVerificationEmail);
}
But then in customUserVerificationEmail, how do I get the verification url in the toMail method?
public function toMail($notifiable)
{
return (new MailMessage)
->subject('Please verify your email address')
->markdown(
'emails.verify',
[
'url' =>// where do I get this $url from?
'notifiable' => $notifiable,
]
);
}
Edit: My solution above could be completely wrong. What I'm trying to achieve is just a way to send two different looking verification emails based on the type of registration, so maybe there is another way
You can probably just copy over the code from the verification mail feature from Laravel.
I would probably extend this class or copy-paste it ;)
Please or to participate in this conversation.