예제 #1
0
 /**
  * Send a test email
  */
 public function processSendMail()
 {
     $smtp_checked = Tools::getValue('smtpChecked') == 'true';
     $server = Tools::getValue('smtpSrv');
     $encryption = Tools::getValue('smtpEnc');
     $port = Tools::getValue('smtpPort');
     $login = Tools::getValue('smtpLogin');
     $password = Tools::getValue('smtpPassword');
     $email = Tools::getValue('testEmail');
     require_once _PS_INSTALL_MODELS_PATH_ . 'mail.php';
     $this->model_mail = new InstallModelMail($smtp_checked, $server, $login, $password, $port, $encryption, $email);
     $result = $this->model_mail->send($this->l('Test message from PrestaShop'), $this->l('This is a test message, your server is now available to send email'));
     $this->ajaxJsonAnswer($result === false, $result === false ? $this->l('A test e-mail has been sent to %s', $email) : $this->l('An error occurred while sending email, please verify your parameters'));
 }
예제 #2
0
 /**
  * PROCESS : sendEmail
  * Send information e-mail
  */
 public function processSendEmail()
 {
     require_once _PS_INSTALL_MODELS_PATH_ . 'mail.php';
     $mail = new InstallModelMail(false, $this->datas->smtp_server, $this->datas->smtp_login, $this->datas->smtp_password, $this->datas->smtp_port, $this->datas->smtp_encryption, $this->datas->admin_email);
     if (file_exists(_PS_INSTALL_LANGS_PATH_ . $this->language->getLanguageIso() . '/mail_identifiers.txt')) {
         $content = file_get_contents(_PS_INSTALL_LANGS_PATH_ . $this->language->getLanguageIso() . '/mail_identifiers.txt');
     } else {
         $content = file_get_contents(_PS_INSTALL_LANGS_PATH_ . InstallLanguages::DEFAULT_ISO . '/mail_identifiers.txt');
     }
     $vars = array('{firstname}' => $this->datas->admin_firstname, '{lastname}' => $this->datas->admin_lastname, '{shop_name}' => $this->datas->shop_name, '{passwd}' => $this->datas->admin_password, '{email}' => $this->datas->admin_email, '{shop_url}' => Tools::getHttpHost(true) . __PS_BASE_URI__);
     $content = str_replace(array_keys($vars), array_values($vars), $content);
     $mail->send($this->l('%s Login information', $this->datas->shop_name), $content);
     return true;
 }
예제 #3
0
 /**
  * PROCESS : sendEmail
  * Send information e-mail
  */
 public function processSendEmail()
 {
     require_once _PS_INSTALL_MODELS_PATH_ . 'mail.php';
     $mail = new InstallModelMail($this->session->use_smtp, $this->session->smtp_server, $this->session->smtp_login, $this->session->smtp_password, $this->session->smtp_port, $this->session->smtp_encryption, $this->session->admin_email);
     if (file_exists(_PS_INSTALL_LANGS_PATH_ . $this->language->getLanguageIso() . '/mail_identifiers.txt')) {
         $content = file_get_contents(_PS_INSTALL_LANGS_PATH_ . $this->language->getLanguageIso() . '/mail_identifiers.txt');
     } else {
         $content = file_get_contents(_PS_INSTALL_LANGS_PATH_ . InstallLanguages::DEFAULT_ISO . '/mail_identifiers.txt');
     }
     $vars = array('{firstname}' => $this->session->admin_firstname, '{lastname}' => $this->session->admin_lastname, '{shop_name}' => $this->session->shop_name, '{passwd}' => $this->session->admin_password, '{email}' => $this->session->admin_email, '{shop_url}' => Tools::getHttpHost(true) . __PS_BASE_URI__);
     $content = str_replace(array_keys($vars), array_values($vars), $content);
     $mail->send($this->l('%s - Login information', $this->session->shop_name), $content);
     // If last step is fine, we store the fact PrestaShop is installed
     $this->session->last_step = 'configure';
     $this->session->step = 'configure';
     $this->ajaxJsonAnswer(true);
 }