Beispiel #1
0
 public function postProcess()
 {
     parent::postProcess();
     if (Tools::isSubmit('feedbackSubmit')) {
         $iso = Language::getIsoById(intval($this->context->language->id));
         $template = 'feedback';
         $subject = 'Сообщение с формы обратный звонок';
         $templateVars = array('{email}' => Tools::getValue('feedback_email'), '{name}' => Tools::getValue('feedback_name'), '{mess}' => Tools::getValue('feedback_mess'));
         //                echo  $f =_PS_ROOT_DIR_.'/mails/'.$iso.'/'.$template.'.txt';
         //                echo file_exists($f);
         //                die();
         $admin_mails = Configuration::get('PS_SHOP_EMAIL');
         if (file_exists(_PS_ROOT_DIR_ . '/mails/' . $iso . '/' . $template . '.txt') and file_exists(_PS_ROOT_DIR_ . '/mails/' . $iso . '/' . $template . '.html')) {
             if (Mail::Send($this->context->language->id, $template, $subject, $templateVars, $admin_mails)) {
                 die(Tools::jsonEncode(1));
             }
         }
         die(Tools::jsonEncode(0));
     }
 }