shop.balmet.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

forgotten.php (1606B)


      1 <?php
      2 class ControllerMailForgotten extends Controller {
      3 	public function index(&$route, &$args, &$output) {			            
      4 		$this->load->language('mail/forgotten');
      5 
      6 		$data['text_greeting'] = sprintf($this->language->get('text_greeting'), html_entity_decode($this->config->get('config_name'), ENT_QUOTES, 'UTF-8'));
      7 		$data['text_change'] = $this->language->get('text_change');
      8 		$data['text_ip'] = $this->language->get('text_ip');
      9 		
     10 		$data['reset'] = str_replace('&amp;', '&', $this->url->link('account/reset', 'code=' . $args[1], true));
     11 		$data['ip'] = $this->request->server['REMOTE_ADDR'];
     12 		
     13 		$mail = new Mail($this->config->get('config_mail_engine'));
     14 		$mail->parameter = $this->config->get('config_mail_parameter');
     15 		$mail->smtp_hostname = $this->config->get('config_mail_smtp_hostname');
     16 		$mail->smtp_username = $this->config->get('config_mail_smtp_username');
     17 		$mail->smtp_password = html_entity_decode($this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8');
     18 		$mail->smtp_port = $this->config->get('config_mail_smtp_port');
     19 		$mail->smtp_timeout = $this->config->get('config_mail_smtp_timeout');
     20 
     21 		$mail->setTo($args[0]);
     22 		$mail->setFrom($this->config->get('config_email'));
     23 		$mail->setSender(html_entity_decode($this->config->get('config_name'), ENT_QUOTES, 'UTF-8'));
     24 		$mail->setSubject(html_entity_decode(sprintf($this->language->get('text_subject'), html_entity_decode($this->config->get('config_name'), ENT_QUOTES, 'UTF-8')), ENT_QUOTES, 'UTF-8'));
     25 		$mail->setText($this->load->view('mail/forgotten', $data));
     26 		$mail->send();
     27 	}
     28 }