function sendResetEmail($user)
 {
     $confirmation_code = str_random(30);
     DB::table('password_resets')->insert(array('email' => $user->email, 'token' => $confirmation_code, 'created_at' => date('Y-m-d h:i:s')));
     $link = \URL::to('system/reset-password') . '/' . $confirmation_code . "  ";
     $mail = \EX::sendEmail($user->email, $user->fullname, 'forgot_password', ['{{RESET_URL}}' => $link, '{{ USERNAME }}' => $user->fullname, '{{ NAME }}' => $user->fullname]);
 }
示例#2
0
 function postLog()
 {
     $lead_id = $this->request->route('id');
     $validator = \Validator::make($this->request->all(), ['comment' => 'required|max:255', 'emailed_to' => 'email']);
     if ($validator->fails()) {
         return redirect()->back()->withErrors($validator)->withInput();
     }
     $lead_id = $this->lead->addLog($this->request->all(), $lead_id);
     if ($this->request->input('emailed_to') != '') {
         $mail = \EX::sendEmail($this->request->input('emailed_to'), '', 'email_log', ['{{LEAD_ID}}' => $lead_id, '{{COMMENT}}' => $this->request->input('comment')]);
     }
     \Flash::success('Log added successfully!');
     return redirect()->back();
 }