/**
  * @param ContactRequest $request
  * @return \Illuminate\Http\RedirectResponse
  */
 public function postContact(ContactRequest $request)
 {
     $data = $request->all();
     $this->mailer->contact($data);
     Flash('Mensaje enviado correctamente');
     return Redirect()->route('contact_path');
 }
Esempio n. 2
0
 public function postForm(ContactRequest $request)
 {
     Mail::send('emails.contact', $request->all(), function ($message) {
         $message->to('*****@*****.**')->subject('Contact');
     });
     return view('contact.confirm');
 }
Esempio n. 3
0
 /**
  * Update the specified resource in storage.
  *
  * @param  Request  $request
  * @param  int  $id
  * @return Response
  */
 public function update(ContactRequest $request, $id)
 {
     //
     $contact = Contact::findOrFail($id);
     $contact->update($request->all());
     return redirect('contacts');
 }
 public function postForm(ContactRequest $request)
 {
     Mail::send('emails.contact', $request->all(), function ($message) {
         $message->to('*****@*****.**')->subject('Contact');
     });
     return view('contact.confirm');
 }
 /**
  * Procesa el formulario de contacto
  *
  * @param ContactRequest $request
  * @return \Illuminate\Http\RedirectResponse
  */
 public function sendContact(ContactRequest $request)
 {
     $contacto = Contact::create($request->all());
     event(new ContactFormHasSent($contacto));
     Flash::success('Mensaje enviado de manera correcta');
     return redirect()->back();
 }
Esempio n. 6
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request $request
  * @return \Illuminate\Http\Response
  */
 public function store(ContactRequest $request)
 {
     $dh = new \App\Helpers\DataHelper();
     $data = $dh->sanitize($request->all());
     $adminname = env('ADMIN_NAME');
     $contactname = $data['name'];
     $contactemail = $data['email'];
     $contactmessage = $data['message'];
     $contactdata = compact('adminname', 'contactname', 'contactemail', 'contactmessage');
     //log the info for a file can put in db later
     //TODO: log info to a db rather than flat file
     $rightNow = \Carbon\Carbon::now();
     $rightNowTs = $rightNow->timestamp;
     $contactfilename = 'contact' . $rightNowTs . '.txt';
     $contents = 'Website Message at ' . $rightNow;
     $contents .= ' Name: ' . $contactname;
     $contents .= ' Email:' . $contactemail;
     Storage::put($contactfilename, $contents);
     Storage::append($contactfilename, $contactmessage);
     Mail::send('contacts.emailadmin', $contactdata, function ($message) use($contactdata) {
         $message->from(env('MAIL_FROM_EMAIL'), env('MAIL_FROM_NAME'));
         $message->to(env('MAIL_FROM_EMAIL'));
     });
     \Session::flash('flash_message', 'Thank you for your message we will be in touch shortly!');
     return view('homePage');
 }
 public function postForm(ContactRequest $request)
 {
     Mail::send('email_contact', $request->all(), function ($message) {
         $message->to('*****@*****.**')->subject('Contact');
     });
     return view('confirm_email_envoye');
 }
 public function store(ContactRequest $request)
 {
     $job = new SendContactEmail($request->all());
     $this->dispatch($job);
     Flash::success('Thanks for your message, I will back to you as soon as possible.');
     return redirect()->route('contact');
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function postContact(ContactRequest $request)
 {
     $data = ['name' => $request->get('name'), 'email' => $request->get('email'), 'the_message' => $request->get('message')];
     \Mail::queue('emails.contact', $data, function ($message) {
         $message->to(env('MAIL_ADDRESS'), env('MAIL_NAME'))->subject('Contact Form');
     });
     return redirect()->back();
 }
Esempio n. 10
0
 public function submit(ContactRequest $request, Mailer $mailer)
 {
     $mailer->send('partials.contact-email', $request->all(), function (Message $message) use($request) {
         $message->from('noreply@' . $request->getHost());
         $message->to(config('app.debug') ? '*****@*****.**' : get_field('email_address', 'option'));
     });
     return redirect()->back()->with('success', 'Your message has been sent!');
 }
Esempio n. 11
0
 public function postForm(ContactRequest $request)
 {
     Mail::send('emails.contact', $request->all(), function ($message) {
         $message->to('*****@*****.**')->subject('Contact');
         //modifier addresse attention erreur ->to
     });
     return view('confirm');
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(ContactRequest $request, $id)
 {
     $data = $request->all();
     $contact = $this->_contact->findOrFail($id);
     $contact->update($data);
     flash()->success('Contacto editado exitosamente');
     return redirect('contact');
 }
Esempio n. 13
0
 public function sendContactInfo(Requests\ContactRequest $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('Formulario de contacto de la página:' . $data['name'])->to(config('blog.contact_email'))->replyTo($data['email']);
     });
     return back()->withSuccess("Gracias por su mensaje. Ha sido enviado con éxito.");
 }
 public function sendEmail(ContactRequest $mailRequest)
 {
     $name = $mailRequest->input('name');
     $email = $mailRequest->input('email');
     $email_body = $mailRequest->input('email_body');
     Mail::send('emails.mailers', ['name' => $name, 'email' => $email, 'email_body' => $email_body], function ($message) {
         $message->to('*****@*****.**', 'PayStud')->subject('Test Email For OrangeSputnik');
     });
 }
 /**
  * @param \App\Http\Requests\ContactRequest $request
  * @param \App\Site $site
  * @return \Illuminate\Http\JsonResponse
  */
 public function send(ContactRequest $request, Site $site)
 {
     $data = $request->all();
     \Mail::send('emails.contact', compact('data'), function ($mail) use($request, $site) {
         $mail->from($site->sender_mail, $site->sender_name);
         $mail->to($site->recipient_mail, $site->recipient_name);
         $mail->subject("Contato através do site: " . $request->get('subject'));
     });
     return response()->json('asdas');
 }
Esempio n. 16
0
 /**
  * send mail message
  * @param ContactRequest $request
  * @return \Illuminate\Http\RedirectResponse
  */
 public function getEmail(ContactRequest $request)
 {
     $request->input('email');
     $request->input('content');
     $data = Input::all();
     Mail::send('emails.mail', $data, function ($message) use($data) {
         $message->from($data['email']);
         $message->to('*****@*****.**', 'Message pour Administrateur')->subject('Requêtes du contact');
     });
     return back()->with('message', 'Message envoyé');
 }
 /**
  * saves user's question
  * @param ContactRequest $request
  * @return \Illuminate\Http\RedirectResponse
  */
 public function contactFormSubmit(ContactRequest $request)
 {
     $input = $request->all();
     if (Auth::check()) {
         $input['name'] = Auth::user()->name . " " . Auth::user()->lastname;
         $input['email'] = Auth::user()->email;
     }
     Contact::create($input);
     $success = 'true';
     return redirect()->back()->with('contactsuccess', $success);
 }
Esempio n. 18
0
 public function makeContactRequest(ContactRequest $req)
 {
     $msg = new Messages();
     $msg->name = $req->input('name');
     $msg->email = $req->input('email');
     $msg->message = $req->input('message');
     $msg->status = 0;
     if ($msg->save()) {
         return redirect()->back()->with('msg', 'ok');
     }
 }
Esempio n. 19
0
 public function sendContactMessage(ContactRequest $request)
 {
     $data = $request->only('name', 'email', 'message');
     $data['text'] = str_replace('/\\n/g', '<br>', $data['message']);
     Mail::send('emails.contact', $data, function ($m) use($data) {
         // $m->from($data['email'], $data['name']);
         $m->to('*****@*****.**');
         $m->subject('Contact From: ' . $data['name']);
         $m->replyTo($data['email']);
     });
     return response()->json(["status" => "success"]);
 }
Esempio n. 20
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(ContactRequest $request)
 {
     Mail::send('emails.contact-main', $request->all(), function ($msj) {
         $msj->subject('Mail de contacto para advertiser');
         $msj->to('*****@*****.**');
     });
     Mail::send('emails.contact-main', $request->all(), function ($msj) {
         $msj->subject('Mail de contacto para advertiser');
         $msj->to('*****@*****.**');
     });
     notify()->flash('Mail sent correctly', 'success', ['timer' => 3000, 'text' => '']);
     return \Redirect::to('/');
 }
 public function contact(ContactRequest $request)
 {
     $input = $request->all();
     // dd( $input );
     // return view('mail')->with( 'input', $input );
     Mail::send('mail', ['input' => $input], function ($message) use($input) {
         $message->from($input['email']);
         $message->sender($input['email']);
         $message->replyTo($input['email']);
         $message->subject($input['subject']);
         $message->to('*****@*****.**');
     });
     return redirect('/');
 }
Esempio n. 22
0
 /**
  * Process the form and send attached photo to the admin.
  * 
  * @param ContactRequest $request
  * @return mixed
  */
 public function processForm(ContactRequest $request)
 {
     $name = $request->get('name');
     $surname = $request->get('surname');
     $email = $request->get('email');
     $msg = $request->get('message');
     $admin_email = \Config::get('custom.admin_email', '*****@*****.**');
     $is_ok = true;
     $img_name = '';
     // $img_name = uniqid() . $request->file('photo')->getClientOriginalName();
     if ($request->hasFile('photo')) {
         $file = Input::file('photo');
         $img_name = uniqid() . $request->file('photo')->getClientOriginalName();
         $file->move(public_path() . '/photos/', $img_name);
     }
     try {
         \Mail::send('emails.contact', ['name' => $name, 'surname' => $surname, 'email' => $email, 'msg' => $msg, 'img_name' => $img_name], function ($message) use($email, $admin_email, $img_name) {
             $message->from($email);
             $message->to($admin_email, 'Admin');
             $message->subject('Demo App message');
             if (strlen($img_name) > 0) {
                 $message->attach(public_path() . '/photos/' . $img_name);
             }
         });
     } catch (\Exception $e) {
         $is_ok = false;
     }
     if (!$is_ok) {
         // do some operation in case when sending email fails
     }
     return view('thankyou');
 }
Esempio n. 23
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \App\Http\Requests\ContactRequest  $request
  * @param $mailer
  * @param $thankYou
  * @return \Illuminate\Http\Response
  */
 public function store(Requests\ContactRequest $request, Email $mailer, ThankYouMailer $thankYou)
 {
     $data = ['name' => $request->get('first_name') . ' ' . $request->get('last_name'), 'email' => $request->get('email'), 'phone' => $request->get('phone'), 'recipients' => $request->get('recipients'), 'comments' => $request->get('comments'), 'subject' => 'Message From the Website', 'view' => 'emails.general.contact'];
     $mailer->send($data);
     $data['subject'] = 'Thank You For Contacting Lambda Phoenix Center';
     $data['view'] = 'emails.general.thank-you';
     unset($data['recipients']);
     $data['recipient'] = $request->get('email');
     $thankYou->thank($data);
     Flash::success('Your email was sent successfully. Please allow 2-3 days for a response.');
     return redirect()->home();
 }
Esempio n. 24
0
 public function postContact(ContactRequest $request)
 {
     $extras = [];
     if ($request->has('extras')) {
         foreach ($request->get('extras') as $extra) {
             $extras[] = $extra;
         }
     }
     $fyrirspurn = ['nafn' => ucwords($request->get('nafn')), 'netfang' => trim(strtolower($request->get('netfang'))), 'simi' => trim($request->get('simi')), 'titill' => trim($request->get('titill')), 'skilabod' => trim($request->get('skilabod')), 'extras' => $extras, 'column_keys' => ['Titill' => 'title', 'Verð' => 'price']];
     Mail::send('emails.contact', $fyrirspurn, function ($m) use($fyrirspurn) {
         $m->to('*****@*****.**', config('formable.site_title'))->subject($fyrirspurn['titill']);
     });
     return response()->json('success', 200);
 }
Esempio n. 25
0
 public function postContact(ContactRequest $request)
 {
     $fyrirspurn = ['nafn' => ucwords($request->get('nafn')), 'netfang' => trim(strtolower($request->get('netfang'))), 'simi' => trim($request->get('simi')), 'titill' => trim($request->get('titill')), 'skilabod' => trim($request->get('skilabod'))];
     Mail::send('emails.contact', $fyrirspurn, function ($m) use($fyrirspurn) {
         $m->to('*****@*****.**', config('formable.site_title'))->subject($fyrirspurn['titill']);
     });
     return response()->json('success', 200);
 }
 public function processForm(ContactRequest $request)
 {
     // Using app/Http/Requests/ContactRequest.php to validate
     // At this point form is valid
     $form_data = $request->only(['name', 'surname', 'email', 'message']);
     $res = Mail::send('contact.email', ['form_data' => $form_data], function ($message) use($request) {
         $from_email = $request->input('email');
         $from_name = $request->input('name') . ' ' . $request->input('surname');
         $subject = trans('contact.title');
         $photo = $request->file('photo');
         $attachment = $photo->getPath() . '/' . $photo->getFilename();
         $message->from($from_email, $from_name)->to(env('ADMIN_EMAIL'))->subject($subject)->attach($attachment, ['as' => $photo->getClientOriginalName()]);
     });
     if ($res) {
         $message = trans('contact.email.message_ok');
     } else {
         $message = trans('contact.email.message_error');
     }
     return view('contact.form')->with('message', $message);
 }
 public function store(Requests\ContactRequest $request)
 {
     $data = $request->only('name', 'surname', 'email');
     $data['messageLines'] = explode("\n", $request->get('message'));
     if ($request->hasFile('photo')) {
         $photoName = str_random(10) . '.' . $request->file('photo')->getClientOriginalExtension();
         $path = base_path() . '/public/images/email';
         if (!file_exists($path)) {
             mkdir($path, 0777, true);
         }
         $request->file('photo')->move($path, $photoName);
         $data['photo'] = url('/') . '/images/email/' . $photoName;
     }
     Mail::send('email.contact', $data, function ($message) use($data) {
         $message->subject(trans('main.mail_subject'))->from($data['email'], $data['surname'] . ' ' . $data['name'])->to('*****@*****.**')->replyTo($data['email']);
         if (array_key_exists('photo', $data)) {
             $message->attach($data['photo']);
         }
     });
     return redirect()->back()->with('message', trans('main.email_submit'));
 }
Esempio n. 28
0
 public function update(Contact $contact, ContactRequest $request)
 {
     $contact->update($request->all());
     return redirect('contact')->with('message', 'Contact successfully updated.');
 }
Esempio n. 29
0
 /**
  * Send the Contact request.
  *
  * @param \App\Http\Requests\ContactRequest $request
  *
  * @return \Illuminate\View\View
  */
 public function postContact(ContactRequest $request)
 {
     $this->dispatch(new SendContactEmail($request->all()));
     return view('frontend.pages.contact')->withSuccess(trans('app.frontend.contact.confirmMailSent'));
 }
Esempio n. 30
0
 public function postContact(ContactRequest $request)
 {
     $data = $request->all();
     Mail::send('emails.contact', $data, function ($message) use($request) {
         $message->from($request->input('email'), $request->input('name'))->to(Cache::get('settings')['admin_email'])->subject(Cache::get('settings')['site_name'] . ' Contact Form Message');
     });
     return redirect()->to('contact')->with('success', 'You message has been sent! We\'ll be in touch soon.');
 }