Beispiel #1
0
 public function addComment($ams_page_id, $data)
 {
     //Akismet to get plugged in here! :-)
     $this->db->query("INSERT INTO #__comments SET author = '" . $this->db->escape($data['name']) . "', " . "customer_id = '" . (int) $this->customer->getId() . "', ams_page_id = '" . (int) $ams_page_id . "'," . " text = '" . $this->db->escape($data['text']) . "', " . "status = '" . (int) $this->config->get('config_comment_auto_approve') . "', date_added = NOW()");
     $comment_id = $this->db->getLastId();
     if ($this->config->get('config_review_mail')) {
         $this->language->load('mail/comment');
         $this->load->model('cms/page');
         $page_item = $this->model_cms_page->loadParent($ams_page_id);
         $subject = sprintf($this->language->get('text_subject'), $this->config->get('config_name'));
         $message = $this->language->get('text_waiting') . "\n";
         $message .= sprintf($this->language->get('text_item'), $this->url->link($page_item->getNamespace(), 'ams_page_id=' . $ams_page_id), $this->db->escape(strip_tags($page_item->name))) . "\n";
         $message .= sprintf($this->language->get('text_reviewer'), $this->db->escape(strip_tags($data['name']))) . "\n";
         $message .= $this->language->get('text_review') . "\n";
         $message .= $this->db->escape(strip_tags($data['text'])) . "\n\n";
         $mail = new \Core\Mail();
         $mail->tags = array('Comment Notification');
         $mail->mandrill_key = $this->config->get('config_mandrill_key');
         $mail->protocol = $this->config->get('config_mail_protocol');
         $mail->parameter = $this->config->get('config_mail_parameter');
         $mail->hostname = $this->config->get('config_mail_smtp_hostname');
         $mail->username = $this->config->get('config_mail_smtp_username');
         $mail->password = $this->config->get('config_mail_smtp_password');
         $mail->port = $this->config->get('config_mail_smtp_port');
         $mail->timeout = $this->config->get('config_mail_smtp_timeout');
         $mail->setTo($this->config->get('config_email'));
         $mail->setFrom($this->config->get('config_email'));
         $mail->setSender($this->config->get('config_name'));
         $mail->setSubject($subject);
         $mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
         $mail->send();
         // Send to additional alert emails
         $emails = explode(',', $this->config->get('config_mail_alert'));
         $addys = array();
         foreach ($emails as $email) {
             if ($email && preg_match('/^[^\\@]+@.*.[a-z]{2,15}$/i', $email)) {
                 //  $mail->setTo($email);
                 $addys[] = $email;
             }
         }
         $mail->send();
     }
 }
Beispiel #2
0
 public function sendMail()
 {
     $this->language->load('sale/contact');
     if ($this->request->server['REQUEST_METHOD'] == 'POST' && $this->validateReply()) {
         //Lodge Reply:
         $this->db->query("insert into #__contact_responses set contact_id = '" . (int) $this->request->get['id'] . "', " . "subject = '" . $this->db->escape($this->request->post['subject']) . "', " . "body = '" . $this->db->escape($this->request->post['message_body']) . "', " . "user_id = '" . (int) $this->user->getId() . "', " . "date_created = now()");
         $mail = new \Core\Mail();
         $mail->mandrill_key = $this->config->get('config_mandrill_key');
         $mail->tags = array('Contact Reply');
         $mail->protocol = $this->config->get('config_mail_protocol');
         $mail->parameter = $this->config->get('config_mail_parameter');
         $mail->hostname = $this->config->get('config_smtp_host');
         $mail->username = $this->config->get('config_smtp_username');
         $mail->password = $this->config->get('config_smtp_password');
         $mail->port = $this->config->get('config_smtp_port');
         $mail->timeout = $this->config->get('config_smtp_timeout');
         $mail->setTo($this->request->post['email']);
         $mail->setFrom($this->config->get('config_email'));
         $mail->setSender($this->config->get('config_name'));
         $mail->setSubject(html_entity_decode($this->request->post['subject']), ENT_QUOTES, 'UTF-8');
         $mail->setText(strip_tags(html_entity_decode($this->request->post['message_body'], ENT_QUOTES, 'UTF-8')));
         $mail->send();
         $this->session->data['success'] = $this->language->get('reply_message');
         $this->redirect($this->url->link('sale/contact', 'token=' . $this->session->data['token'], 'SSL'));
     } else {
         $this->contact_details();
     }
 }
Beispiel #3
0
 public function submit()
 {
     $this->load->language('common/contact');
     if ($this->validate()) {
         unset($this->session->data['captcha']);
         $this->language->load('common/contact');
         $mail = new \Core\Mail();
         $mail->tags = array('Contact Request');
         $mail->mandrill_key = $this->config->get('config_mandrill_key');
         $mail->protocol = $this->config->get('config_mail_protocol');
         $mail->parameter = $this->config->get('config_mail_parameter');
         $mail->hostname = $this->config->get('config_mail_smtp_hostname');
         $mail->username = $this->config->get('config_mail_smtp_username');
         $mail->password = $this->config->get('config_mail_smtp_password');
         $mail->port = $this->config->get('config_mail_smtp_port');
         $mail->timeout = $this->config->get('config_mail_smtp_timeout');
         $post = $this->request->post;
         unset($post['custom_field']);
         $mailbody = "Contact form Submission \n";
         $mailbody .= $this->language->get('entry_name') . ": " . $this->request->post['name'] . "\n";
         $mailbody .= $this->language->get('entry_email') . ": " . $this->request->post['email'] . "\n";
         $mailbody .= $this->language->get('entry_enquiry') . ": " . $this->request->post['enquiry'] . "\n";
         $fields = $this->model_account_custom_field->getCustomFields();
         foreach ($fields as $cfield) {
             if ($cfield['location'] == 'contact') {
                 $mailbody .= $cfield['name'] . ": " . $this->request->post['custom_field'][$cfield['custom_field_id']] . "\n";
                 $post['custom_field'][$cfield['name']] = $this->request->post['custom_field'][$cfield['custom_field_id']];
             }
         }
         $mailbody .= "\n\n\n------------------------------------------\n";
         $mailbody .= "" . DATE("Y-m-d h:i a") . " | " . $this->request->server['REMOTE_ADDR'];
         $this->event->trigger('contact.form.submit.body', $mailbody);
         $mailsubject = sprintf($this->language->get('email_subject'), $this->request->post['name']);
         $this->event->trigger('contact.form.submit.subject', $mailsubject);
         $this->load->model('account/contact');
         $this->model_account_contact->addContact($post);
         $mail->setTo($this->config->get('config_email'));
         $mail->setFrom($this->config->get('config_email'));
         $mail->setSender($this->request->post['name']);
         $mail->setReplyTo($this->request->post['email']);
         $mail->setSubject($mailsubject);
         $mail->setText($mailbody);
         $mail->setHtml(nl2br($mailbody));
         $mail->send();
         $data['success'] = $this->language->get('text_success');
         //   $this->redirect($this->url->link('common/contact/success'));
     } else {
         $data['error'] = $this->error;
     }
     $this->response->addHeader('Content-Type: application/json');
     $this->response->setOutput(json_encode($data));
 }
Beispiel #4
0
 public function approve($customer_id)
 {
     $customer_info = $this->getCustomer($customer_id);
     if ($customer_info) {
         $this->db->query("UPDATE #__customer SET approved = '1' WHERE customer_id = '" . (int) $customer_id . "'");
         $this->load->language('mail/customer');
         $store_name = $this->config->get('config_name');
         $store_url = HTTP_CATALOG . 'index.php?p=account/login';
         $message = sprintf($this->language->get('text_approve_welcome'), $store_name) . "\n\n";
         $message .= $this->language->get('text_approve_login') . "\n";
         $message .= $store_url . "\n\n";
         $message .= $this->language->get('text_approve_services') . "\n\n";
         $message .= $this->language->get('text_approve_thanks') . "\n";
         $message .= $store_name;
         $mail = new \Core\Mail();
         $mail->tags = array('Customer Approve');
         $mail->mandrill_key = $this->config->get('config_mandrill_key');
         $mail->protocol = $this->config->get('config_mail_protocol');
         $mail->parameter = $this->config->get('config_mail_parameter');
         $mail->hostname = $this->config->get('config_mail_smtp_hostname');
         $mail->username = $this->config->get('config_mail_smtp_username');
         $mail->password = $this->config->get('config_mail_smtp_password');
         $mail->port = $this->config->get('config_mail_smtp_port');
         $mail->timeout = $this->config->get('config_mail_smtp_timeout');
         $mail->setTo($customer_info['email']);
         $mail->setFrom($this->config->get('config_email'));
         $mail->setSender($store_name);
         $mail->setSubject(sprintf($this->language->get('text_approve_subject'), $store_name));
         $mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
         $mail->send();
     }
 }
Beispiel #5
0
 public function addCustomer($data)
 {
     if (isset($data['customer_group_id']) && is_array($this->config->get('config_customer_group_display')) && in_array($data['customer_group_id'], $this->config->get('config_customer_group_display'))) {
         $customer_group_id = $data['customer_group_id'];
     } else {
         $customer_group_id = $this->config->get('config_customer_group_id');
     }
     $this->load->model('account/customer_group');
     $customer_group_info = $this->model_account_customer_group->getCustomerGroup($customer_group_id);
     $this->db->query("INSERT INTO #__customer SET customer_group_id = '" . (int) $customer_group_id . "', " . " firstname = '" . $this->db->escape($data['firstname']) . "', " . " lastname = '" . $this->db->escape($data['lastname']) . "'," . " email = '" . $this->db->escape($data['email']) . "', " . " telephone = '" . $this->db->escape($data['telephone']) . "', " . " salt = '" . $this->db->escape($salt = substr(md5(uniqid(rand(), true)), 0, 9)) . "', " . " password = '******'password'])))) . "', " . " custom_field = '" . $this->db->escape(isset($data['custom_field']['account']) ? serialize($data['custom_field']['account']) : '') . "', " . " newsletter = '" . (isset($data['newsletter']) ? (int) $data['newsletter'] : 0) . "', " . " ip = '" . $this->db->escape($this->request->server['REMOTE_ADDR']) . "', " . " status = '1', " . " approved = '" . (int) (!$customer_group_info['approval']) . "', " . " country_id = '" . (int) $data['country_id'] . "', " . " date_added = NOW()");
     $customer_id = $this->db->getLastId();
     $this->load->language('mail/customer');
     $subject = sprintf($this->language->get('text_subject'), $this->config->get('config_name'));
     $message = sprintf($this->language->get('text_welcome'), $this->config->get('config_name')) . "\n\n";
     if (!$customer_group_info['approval']) {
         $message .= $this->language->get('text_login') . "\n";
     } else {
         $message .= $this->language->get('text_approval') . "\n";
     }
     $message .= $this->url->link('account/login', '', 'SSL') . "\n\n";
     $message .= $this->language->get('text_services') . "\n\n";
     $message .= $this->language->get('text_thanks') . "\n";
     $message .= $this->config->get('config_name');
     $mail = new \Core\Mail();
     $mail->tags = array('Customer Registration');
     $mail->mandrill_key = $this->config->get('config_mandrill_key');
     $mail->protocol = $this->config->get('config_mail_protocol');
     $mail->parameter = $this->config->get('config_mail_parameter');
     $mail->hostname = $this->config->get('config_mail_smtp_hostname');
     $mail->username = $this->config->get('config_mail_smtp_username');
     $mail->password = $this->config->get('config_mail_smtp_password');
     $mail->port = $this->config->get('config_mail_smtp_port');
     $mail->timeout = $this->config->get('config_mail_smtp_timeout');
     $mail->setTo($data['email']);
     $mail->setFrom($this->config->get('config_email'));
     $mail->setSender($this->config->get('config_name'));
     $mail->setSubject($subject);
     $mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
     $mail->send();
     // Send to main admin email if new account email is enabled
     if ($this->config->get('config_account_mail')) {
         $this->language->load('mail/customer');
         $message = $this->language->get('text_signup') . "\n\n";
         $message .= $this->language->get('text_website') . ' ' . $this->config->get('config_name') . "\n";
         $message .= $this->language->get('text_firstname') . ' ' . $data['firstname'] . "\n";
         $message .= $this->language->get('text_lastname') . ' ' . $data['lastname'] . "\n";
         $message .= $this->language->get('text_customer_group') . ' ' . $customer_group_info['name'] . "\n";
         $message .= $this->language->get('text_email') . ' ' . $data['email'] . "\n";
         $message .= $this->language->get('text_telephone') . ' ' . $data['telephone'] . "\n";
         $mail->setTo($this->config->get('config_email'));
         $mail->setSubject(html_entity_decode($this->language->get('text_new_customer'), ENT_QUOTES, 'UTF-8'));
         $mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
         $mail->send();
         // Send to additional alert emails if new account email is enabled
         $emails = explode(',', $this->config->get('config_mail_alert'));
         foreach ($emails as $email) {
             if (utf8_strlen($email) > 0 && preg_match('/^[^\\@]+@.*.[a-z]{2,15}$/i', $email)) {
                 $mail->setTo($email);
                 $mail->send();
             }
         }
     }
     return $customer_id;
 }
Beispiel #6
0
 public function index()
 {
     $this->load->language('common/contact');
     $this->document->setTitle($this->language->get('heading_title'));
     if ($this->request->server['REQUEST_METHOD'] == 'POST' && $this->validate()) {
         unset($this->session->data['captcha']);
         $this->language->load('common/contact');
         $mail = new \Core\Mail();
         $mail->tags = array('Contact Request');
         $mail->mandrill_key = $this->config->get('config_mandrill_key');
         $mail->protocol = $this->config->get('config_mail_protocol');
         $mail->parameter = $this->config->get('config_mail_parameter');
         $mail->hostname = $this->config->get('config_mail_smtp_hostname');
         $mail->username = $this->config->get('config_mail_smtp_username');
         $mail->password = $this->config->get('config_mail_smtp_password');
         $mail->port = $this->config->get('config_mail_smtp_port');
         $mail->timeout = $this->config->get('config_mail_smtp_timeout');
         $post = $this->request->post;
         unset($post['custom_field']);
         $mailbody = "Contact form Submission \n";
         $mailbody .= $this->language->get('entry_name') . ": " . $this->request->post['name'] . "\n";
         $mailbody .= $this->language->get('entry_email') . ": " . $this->request->post['email'] . "\n";
         $mailbody .= $this->language->get('entry_enquiry') . ": " . $this->request->post['enquiry'] . "\n";
         $fields = $this->model_account_custom_field->getCustomFields();
         foreach ($fields as $cfield) {
             if ($cfield['location'] == 'contact') {
                 $mailbody .= $cfield['name'] . ": " . $this->request->post['custom_field'][$cfield['custom_field_id']] . "\n";
                 $post['custom_field'][$cfield['name']] = $this->request->post['custom_field'][$cfield['custom_field_id']];
             }
         }
         $mailbody .= "\n\n\n------------------------------------------\n";
         $mailbody .= "" . DATE("Y-m-d h:i a") . " | " . $this->request->server['REMOTE_ADDR'];
         $this->event->trigger('contact.form.submit.body', $mailbody);
         $mailsubject = sprintf($this->language->get('email_subject'), $this->request->post['name']);
         $this->event->trigger('contact.form.submit.subject', $mailsubject);
         $this->load->model('account/contact');
         $this->model_account_contact->addContact($post);
         $mail->setTo($this->config->get('config_email'));
         $mail->setFrom($this->config->get('config_email'), $this->request->post['name']);
         $mail->setReplyTo($this->request->post['email']);
         $mail->setSender($this->request->post['name']);
         $mail->setSubject($mailsubject);
         $mail->setText($mailbody);
         $mail->setHtml(nl2br($mailbody));
         $mail->send();
         $this->redirect($this->url->link('common/contact/success'));
     }
     $data['breadcrumbs'] = array();
     $data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home'));
     $data['breadcrumbs'][] = array('text' => $this->language->get('heading_title'), 'href' => $this->url->link('common/contact'));
     $data['heading_title'] = $this->language->get('heading_title');
     $data['text_location'] = $this->language->get('text_location');
     $data['text_store'] = $this->language->get('text_store');
     $data['text_contact'] = $this->language->get('text_contact');
     $data['text_address'] = $this->language->get('text_address');
     $data['text_telephone'] = $this->language->get('text_telephone');
     $data['text_fax'] = $this->language->get('text_fax');
     $data['text_comment'] = $this->language->get('text_comment');
     $data['entry_name'] = $this->language->get('entry_name');
     $data['entry_email'] = $this->language->get('entry_email');
     $data['entry_enquiry'] = $this->language->get('entry_enquiry');
     $data['entry_captcha'] = $this->language->get('entry_captcha');
     $data['button_map'] = $this->language->get('button_map');
     if (isset($this->error['name'])) {
         $data['error_name'] = $this->error['name'];
     } else {
         $data['error_name'] = '';
     }
     if (isset($this->error['email'])) {
         $data['error_email'] = $this->error['email'];
     } else {
         $data['error_email'] = '';
     }
     if (isset($this->error['enquiry'])) {
         $data['error_enquiry'] = $this->error['enquiry'];
     } else {
         $data['error_enquiry'] = '';
     }
     if (isset($this->error['captcha'])) {
         $data['error_captcha'] = $this->error['captcha'];
     } else {
         $data['error_captcha'] = '';
     }
     if (isset($this->error['custom_field'])) {
         $data['error_custom_field'] = $this->error['custom_field'];
     } else {
         $data['error_custom_field'] = array();
     }
     $data['button_submit'] = $this->language->get('button_submit');
     $data['action'] = $this->url->link('common/contact');
     /*
      $this->load->model('tool/image');
     
      if ($this->config->get('config_image')) {
      $data['image'] = $this->model_tool_image->resize($this->config->get('config_image'), $this->config->get('config_image_location_width'), $this->config->get('config_image_location_height'));
      } else {
      $data['image'] = false;
      }
     */
     $data['store'] = $this->config->get('config_name');
     if (isset($this->request->post['name'])) {
         $data['name'] = $this->request->post['name'];
     } else {
         $data['name'] = $this->customer->getFirstName();
     }
     if (isset($this->request->post['email'])) {
         $data['email'] = $this->request->post['email'];
     } else {
         $data['email'] = $this->customer->getEmail();
     }
     if (isset($this->request->post['enquiry'])) {
         $data['enquiry'] = $this->request->post['enquiry'];
     } else {
         $data['enquiry'] = '';
     }
     if (isset($this->request->post['captcha'])) {
         $data['captcha'] = $this->request->post['captcha'];
     } else {
         $data['captcha'] = '';
     }
     $this->load->model('account/custom_field');
     $data['custom_fields'] = $this->model_account_custom_field->getCustomFields();
     if (isset($this->request->post['custom_field'])) {
         $data['contact_custom_field'] = $this->request->post['custom_field'];
     } else {
         $data['contact_custom_field'] = array();
     }
     $this->document->addScript('view/plugins/datetimepicker/moment.js');
     $this->document->addScript('view/plugins/datetimepicker/bootstrap-datetimepicker.min.js');
     $this->document->addStyle('view/plugins/datetimepicker/bootstrap-datetimepicker.min.css');
     $this->children = array('common/column_top', 'common/column_bottom', 'common/column_left', 'common/column_right', 'common/content_top', 'common/content_bottom', 'common/footer', 'common/header');
     $this->template = 'common/contact.phtml';
     $this->data = $data;
     $this->response->setOutput($this->render());
 }
Beispiel #7
0
 public function index()
 {
     if ($this->customer->isLogged()) {
         $this->redirect($this->url->link('account/account', '', 'SSL'));
     }
     $this->load->language('account/forgotten');
     $this->document->setTitle($this->language->get('heading_title'));
     $this->load->model('account/customer');
     if ($this->request->server['REQUEST_METHOD'] == 'POST' && $this->validate()) {
         $this->load->language('mail/forgotten');
         $password = substr(sha1(uniqid(mt_rand(), true)), 0, 10);
         $this->model_account_customer->editPassword($this->request->post['email'], $password);
         $subject = sprintf($this->language->get('text_subject'), $this->config->get('config_name'));
         $message = sprintf($this->language->get('text_greeting'), $this->config->get('config_name')) . "\n\n";
         $message .= $this->language->get('text_password') . "\n\n";
         $message .= $password;
         $mail = new \Core\Mail();
         $mail->tags = array('Forgotten Password');
         $mail->mandrill_key = $this->config->get('config_mandrill_key');
         $mail->protocol = $this->config->get('config_mail_protocol');
         $mail->parameter = $this->config->get('config_mail_parameter');
         $mail->hostname = $this->config->get('config_mail_smtp_hostname');
         $mail->username = $this->config->get('config_mail_smtp_username');
         $mail->password = $this->config->get('config_mail_smtp_password');
         $mail->port = $this->config->get('config_mail_smtp_port');
         $mail->timeout = $this->config->get('config_mail_smtp_timeout');
         $mail->setTo($this->request->post['email']);
         $mail->setFrom($this->config->get('config_email'));
         $mail->setSender($this->config->get('config_name'));
         $mail->setSubject($subject);
         $mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
         $mail->send();
         $this->session->data['success'] = $this->language->get('text_success');
         // Add to activity log
         $customer_info = $this->model_account_customer->getCustomerByEmail($this->request->post['email']);
         if ($customer_info) {
             $this->load->model('account/activity');
             $activity_data = array('customer_id' => $customer_info['customer_id'], 'name' => $customer_info['firstname'] . ' ' . $customer_info['lastname']);
             $this->model_account_activity->addActivity('forgotten', $activity_data);
         }
         $this->redirect($this->url->link('account/login', '', 'SSL'));
     }
     $data['breadcrumbs'] = array();
     $data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home'));
     $data['breadcrumbs'][] = array('text' => $this->language->get('text_account'), 'href' => $this->url->link('account/account', '', 'SSL'));
     $data['breadcrumbs'][] = array('text' => $this->language->get('text_forgotten'), 'href' => $this->url->link('account/forgotten', '', 'SSL'));
     $data['heading_title'] = $this->language->get('heading_title');
     $data['text_your_email'] = $this->language->get('text_your_email');
     $data['text_email'] = $this->language->get('text_email');
     $data['entry_email'] = $this->language->get('entry_email');
     $data['button_continue'] = $this->language->get('button_continue');
     $data['button_back'] = $this->language->get('button_back');
     if (isset($this->error['warning'])) {
         $data['error_warning'] = $this->error['warning'];
     } else {
         $data['error_warning'] = '';
     }
     $data['action'] = $this->url->link('account/forgotten', '', 'SSL');
     $data['back'] = $this->url->link('account/login', '', 'SSL');
     $this->template = 'account/forgotten.phtml';
     $this->data = $data;
     $this->children = array('common/column_top', 'common/column_bottom', 'common/column_left', 'common/column_right', 'common/content_top', 'common/content_bottom', 'common/footer', 'common/header');
     $this->response->setOutput($this->render());
 }
Beispiel #8
0
 public function index()
 {
     if ($this->user->isLogged()) {
         $this->user->logout();
         //  $this->redirect($this->url->link('common/home', '', 'SSL'));
     }
     $this->language->load('user/forgotten');
     $this->document->setTitle($this->language->get('heading_title'));
     $this->load->model('user/user');
     if ($this->request->server['REQUEST_METHOD'] == 'POST' && $this->validate()) {
         $this->language->load('mail/forgotten');
         $code = sha1(uniqid(mt_rand(), true));
         $this->model_user_user->editCode($this->request->post['email'], $code);
         $subject = sprintf($this->language->get('text_subject'), $this->config->get('config_name'));
         $message = sprintf($this->language->get('text_greeting'), $this->config->get('config_name')) . "\n\n";
         $message .= sprintf($this->language->get('text_change'), $this->config->get('config_name')) . "\n\n";
         $message .= $this->url->link('user/reset', 'code=' . $code, 'SSL') . "\n\n";
         $message .= sprintf($this->language->get('text_ip'), $this->request->server['REMOTE_ADDR']) . "\n\n";
         $mail = new \Core\Mail();
         $mail->mandrill_key = $this->config->get('config_mandrill_key');
         $mail->tags = array('Forgotten Password');
         $mail->protocol = $this->config->get('config_mail_protocol');
         $mail->parameter = $this->config->get('config_mail_parameter');
         $mail->hostname = $this->config->get('config_smtp_host');
         $mail->username = $this->config->get('config_smtp_username');
         $mail->password = $this->config->get('config_smtp_password');
         $mail->port = $this->config->get('config_smtp_port');
         $mail->timeout = $this->config->get('config_smtp_timeout');
         $mail->setTo($this->request->post['email']);
         $mail->setFrom($this->config->get('config_email'));
         $mail->setSender($this->config->get('config_name'));
         $mail->setSubject(html_entity_decode($subject, ENT_QUOTES, 'UTF-8'));
         $mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
         $mail->send();
         $this->session->data['success'] = $this->language->get('text_success');
         $this->redirect($this->url->link('user/login', '', 'SSL'));
     }
     $this->data['breadcrumbs'] = array();
     $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home'), 'separator' => false);
     $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_forgotten'), 'href' => $this->url->link('user/forgotten', '', 'SSL'), 'separator' => $this->language->get('text_separator'));
     $this->data['heading_title'] = $this->language->get('heading_title');
     $this->data['text_your_email'] = $this->language->get('text_your_email');
     $this->data['text_email'] = $this->language->get('text_email');
     $this->data['entry_email'] = $this->language->get('entry_email');
     $this->data['button_reset'] = $this->language->get('button_reset');
     $this->data['button_cancel'] = $this->language->get('button_cancel');
     if (isset($this->error['warning'])) {
         $this->data['error_warning'] = $this->error['warning'];
     } else {
         $this->data['error_warning'] = '';
     }
     $this->data['action'] = $this->url->link('user/forgotten', '', 'SSL');
     $this->data['cancel'] = $this->url->link('user/login', '', 'SSL');
     if (isset($this->request->post['email'])) {
         $this->data['email'] = $this->request->post['email'];
     } else {
         $this->data['email'] = '';
     }
     $this->data['title'] = $this->document->getTitle();
     if (isset($this->request->server['HTTPS']) && ($this->request->server['HTTPS'] == 'on' || $this->request->server['HTTPS'] == '1')) {
         $this->data['base'] = HTTPS_SERVER;
     } else {
         $this->data['base'] = HTTP_SERVER;
     }
     $this->template = 'user/forgotten.phtml';
     $this->response->setOutput($this->render());
 }