- This topic has 0 replies, 1 voice, and was last updated 8 years, 10 months ago by Layer7web.
Viewing 0 reply threads
-
AuthorPosts
-
-
January 9, 2016 at 4:26 pm #2231
Layer7webKeymasterThis is actually the codeigniter email library. I have added this to the codeigniter forum as well.
Create and Send Email SnipetPHP1234567891011121314151617181920212223242526272829303132$this->load->library('encrypt');$this->load->library('email');//-- setup request$request_array = array($user->generate_reset_key(), $user->id, $user->email, time());$request_string = implode($this->_request_delimiter, $request_array);$encoded_request = base64url_encode( $this->encrypt->encode($request_string) );//send the email$this->email->initialize(array('mailtype' => 'html'));$this->email->from($this->config->item('from_noreply'), $this->config->item('website_name'));$this->email->to($user->email);$this->email->subject($this->config->item('website_name').' Password Reset Request');$view_data = array('email' => $user->email,'request' => $encoded_request,'lang' => $user->language);$message = $this->load->view('_emails/reset_password', $view_data, TRUE);$this->email->message($message);if($this->email->send()){return true;}else{log_message('ERROR', __CLASS__.'->'.__FUNCTION__.' failed to send reset request email to '.$user->email);}return false;- This topic was modified 8 years, 10 months ago by Layer7web.
-
-
AuthorPosts
Viewing 0 reply threads
You must be logged in to reply to this topic.
Comments are closed.