shop.balmet.com

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

forgotten.php (1489B)


      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 		
      8 		$data['reset'] = str_replace('&amp;', '&', $this->url->link('common/reset', 'code=' . $args[1], true));
      9 		$data['ip'] = $this->request->server['REMOTE_ADDR'];
     10 		
     11 		$mail = new Mail($this->config->get('config_mail_engine'));
     12 		$mail->parameter = $this->config->get('config_mail_parameter');
     13 		$mail->smtp_hostname = $this->config->get('config_mail_smtp_hostname');
     14 		$mail->smtp_username = $this->config->get('config_mail_smtp_username');
     15 		$mail->smtp_password = html_entity_decode($this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8');
     16 		$mail->smtp_port = $this->config->get('config_mail_smtp_port');
     17 		$mail->smtp_timeout = $this->config->get('config_mail_smtp_timeout');
     18 
     19 		$mail->setTo($args[0]);
     20 		$mail->setFrom($this->config->get('config_email'));
     21 		$mail->setSender(html_entity_decode($this->config->get('config_name'), ENT_QUOTES, 'UTF-8'));
     22 		$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'));
     23 		$mail->setText($this->load->view('mail/forgotten', $data));
     24 		$mail->send();
     25 	}
     26 }