I am trying to send email in laravel for which I am using the mail::send functon.
This is my code
$data = [
'title'=>'Some Title',
'content'=>'Content',
'email'=> 'email',
'password'=>'password',
'remarks'=>'remarks'
];
Mail::send('admin.mails.activate', $data, ['user'=>$user], function ($message) use ($user) {
$message->to($user->email, $user->name)->subject('Account Activation Email')->from('support@webmail.com');
});
I am trying to pass the $data variable to the view file and $user variable to the callback function so that I could use user's email to send email. But it is giving me this error.
call_user_func() expects parameter 1 to be a valid callback, array must have exactly two members
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire