I have a function of new user sign up that sends and email on registration. When i go via the registration process it should store a record and then fire the email.
So i have used the 'Registered'
trait which is firing fine but I cant get the email address to pull from the data i have sent in
protected function registered(Request $request, $user)
{
Mail::send('email.send', $user = ['name'=>$user['name'], 'surname'=>$user['surname'], 'email'=>$user['email']], function ($message) {
$message->from('noreply@geniusmoney.co.uk');
$message->sender('noreply@geniusmoney.co.uk');
$message->to($user->email);
$message->bcc('geniusteam@geniusmoney.co.uk');
$message->subject('Welcome to Genius Money');
$message->attach('attachments/contract10.pdf');
$message->attach('attachments/entitychecklist.pdf');
$message->from('noreply@geniusmoney.co.uk', 'Welcome to Genius Money');
});
}
My error is:
Undefined variable: user and that points to my $message->to