Example #1
0
 public function sendContactMessage(Request $request, AppMailer $mailer)
 {
     // Validate request.
     $this->validate($request, ['name' => 'required|max:255', 'email' => 'required|email|max:255', 'message' => 'required']);
     // Send message.
     $mailer->sendContactMessage($request);
     // Send message has been recieved.
     $mailer->sendRecievedContactMessage($request);
     // Flash message.
     session()->flash('message', 'Your message has been sent!  We will get back to you as soon as possible.');
     // Redirect back.
     return redirect('contact');
 }