Exemplo n.º 1
0
 /**
  * Email the contact request
  *
  * @param ContactMeRequest $request
  * @return Redirect
  */
 public function sendContactInfo(ContactMeRequest $request)
 {
     $data = $request->only('name', 'email', 'phone');
     $data['messageLines'] = explode("\n", $request->get('message'));
     Mail::queue('emails.contact', $data, function ($message) use($data) {
         $message->subject('Blog Contact Form: ' . $data['name'])->to(config('blog.contact_email'))->replyTo($data['email']);
     });
     return back()->withSuccess("Thank you for your message. It has been sent.");
 }
Exemplo n.º 2
0
 /**
  * Email the contact request
  *
  * @param ContactMeRequest $request
  * @return Redirect
  */
 public function sendContactInfo(ContactMeRequest $request)
 {
     $data = $request->only('name', 'email', 'phone');
     $data['messageLines'] = explode("\n", $request->get('message'));
     Mail::send('emails.contact', $data, function ($message) use($data) {
         $message->subject('Blog Contact Form: ' . $data['name'])->to('*****@*****.**')->replyTo($data['email']);
     });
     Mail::send('emails.reponse', ['testVar' => 'Just a silly test'], function ($message) use($data) {
         $message->to($data['email'])->subject('Confirmation');
     });
     return back()->withSuccess("Merci, Votre message à été bien enregistré, -----SM-DEVIS.");
 }