I have a contact form with fields like name, email, phone, etc. I want to pass the fields into the email sent and the example i tried below doesnt seem to send the variables to the html email thats being sent out.
this is in the Route::post of this page:
$data = [ 'name' => $request->input('name'), 'email' => $request->input('email'), 'phone' => $request->input('phone'), 'message' => $request->input('message') ];
Mail::to('[email protected]')->send(new ContactForm($data));
then in the contactform.php under the mail folder within the build method i have
public function build()
{
return $this->from('[email protected]')->view('emails.app.contact-form-submission');
}