Пример #1
0
 /**
  * Update the specified resource in storage.
  *
  * @param  Request  $request
  * @param  int  $id
  * @return Response
  */
 public function update(EmailRequest $request, $id)
 {
     $email = Email::findOrFail($id);
     $email->fill($request->all());
     $email->save();
     return Redirect::back()->with("good", "Successfully updated email template.");
 }
Пример #2
0
 public function postForm(EmailRequest $request, Email $email)
 {
     $email->email = $request->input('email');
     $email->libelle = $request->input('libelle');
     $email->save();
     return view('email_ok');
 }
Пример #3
0
 public function listing(EmailRequest $request)
 {
     $page = $request->input('page');
     $limit = $request->input('limit');
     $resp = $this->repo->listing($page, $limit);
     if (!empty($resp)) {
         return response()->json(['status' => 'success', 'data' => $resp, 'code' => 200], 200);
     }
 }
Пример #4
0
 public function send(EmailRequest $request)
 {
     $input = $request->all();
     Message::create($input);
     $headers = "From: " . $input['sender'];
     if (isset($input['copyme'])) {
         $headers .= "\r\nCC: " . $input['sender'] . "\r\n";
     }
     mail('*****@*****.**', $input['subject'], $input['body'], $headers);
     $confirm = "Thanks for the email!  I will get back to you soon.";
     return view('resume.contact', compact('confirm'));
 }
Пример #5
0
 public function send(EmailRequest $request)
 {
     // Collect info from forms
     $name = $request->input('name');
     $from_email = $request->input('email');
     $message_text = $request->input('message');
     $emails = Email::lists('email')->toArray();
     Mail::send('emails.contact-us', ['name' => $name, 'message_text' => $message_text], function ($message) use($name, $from_email, $emails) {
         $message->from($from_email, $name);
         $message->to($emails)->subject('MyFollowUp - Contact Us');
     });
     return redirect('/');
 }
 /**
  * Submits Email To Be Recovered by Post method
  *
  * @param $request
  * @return response
  */
 public function sendLink(Request $request)
 {
     $emailRequest = new EmailRequest();
     $validator = Validator::make($request->all(), $emailRequest->rules(), $emailRequest->messages());
     if ($validator->fails()) {
         return response()->json(['success' => false, 'errors' => $validator->errors()->toArray()], 400);
     }
     if ($this->captchaCheck() == false) {
         $errors = ['captchaError' => trans('auth.captchaError')];
         return response()->json(['success' => false, 'errors' => $errors], 400);
     }
     $user = User::where('email', $request->email)->firstOrFail();
     $activation_code = str_random(60) . $request->input('email');
     $user->activation_code = $activation_code;
     $user->save();
     $this->mail->passwordLink($user);
     return response()->json(['success' => true, 'message' => 'We Have  Sent You An Email For Password Reset!'], 200);
 }
Пример #7
0
 public function postForm(EmailRequest $request, EmailRepositoryInterface $emailRepository)
 {
     $emailRepository->save($request->input('email'));
     return view('email_ok');
 }
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(EmailRequest $request)
 {
     Email::create($request->all());
     return Redirect::back()->with('emailSubscribe', 'Thank you for subscribing!');
 }
Пример #9
0
 /**
  * 密码重置发送邮件
  *
  * @param EmailRequest $request
  * @param MailService $mail
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function postEmail(EmailRequest $request, MailService $mail)
 {
     $email = $request->get('email');
     $user = $this->authRepository->getUser('email', $email);
     if ($user) {
         $mail->send('authority.mail', ['reset_code' => $user->reset_code], $email, trans('passwords.subject'));
         return back()->with('status', trans('passwords.sent'));
     }
     return back()->with('fail', trans('passwords.nouser'));
 }
Пример #10
0
 public function postEmail(EmailRequest $emailRequest, EmailRepository $emailRepository)
 {
     $emailRepository->save($emailRequest->input('email'));
     return view('op.email.email_ok');
 }
 public function editEmailUser(Requests\EmailRequest $request, $id)
 {
     if ($request->ajax()) {
         $user = User::find($id);
         $user->email = $request->email;
         $user->save();
     }
 }
Пример #12
0
 /**
  * 更新订阅资料
  *
  * @param EmailRequest $request
  *
  * @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\View\View
  */
 public function updateProfile(EmailRequest $request)
 {
     $email = $request->get('email');
     $subscribeUser = $this->subscribeRepository->checkUser($request->get('confirmCode'));
     $checkEmail = $this->subscribeRepository->checkEmail($email);
     // 数据库有此邮箱 不管激活与否
     if ($checkEmail && $subscribeUser->email !== $email) {
         return back()->with('repeatEmail', trans('email.repeatEmail'));
     }
     // 数据库中没有此邮箱
     $this->subscribeRepository->update($request->except('confirmCode'), $subscribeUser->id);
     return view('frontend.subscribe.update', compact('subscribeUser'));
 }