Home › Forums › fuelCMS › Create and Send Email
This is actually the codeigniter email library. I have added this to the codeigniter forum as well.
$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;
You must be logged in to reply to this topic.