コード例 #1
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(SendEmailRequest $emailRequest)
 {
     $values = $emailRequest->all();
     $values['status'] = 1;
     if ($values['birthday'] === '') {
         Email::create($values);
         Flash::message('Your email has been sent. Thank you!');
     }
     return redirect('contact');
 }
コード例 #2
0
 public function postShareByEmail(SendEmailRequest $request)
 {
     $data = $request->all();
     // dd($data);
     $myemail = $request->get('myemail');
     $hisemail = $request->get('hisemail');
     $body = nl2br($request->get('message'));
     Mail::send('emails.share', ['body' => $body], function ($message) use($myemail, $hisemail, $body) {
         $message->from($myemail);
         $message->to($hisemail);
         $message->subject('Soluțiile Canon pentru un business flexibil');
     });
     return response()->json(['status' => 'OK', 'message' => 'Formularul nu a fost completat']);
 }