29 lines
865 B
PHP
29 lines
865 B
PHP
<?php
|
|
/**
|
|
* Description of privatesalesnewsletter
|
|
*
|
|
* @company Antadis
|
|
*/
|
|
|
|
class privatesalesnewsletterModuleFrontController extends ModuleFrontController {
|
|
|
|
|
|
|
|
public function ajaxProcessSubmitNewsletter(){
|
|
echo "ok";
|
|
$id_privatesales = Tools::getValue('id_privatesales');
|
|
if($id_privatesales)
|
|
$this->content = Tools::jsonEncode(array('hasError' => true));
|
|
|
|
$customer = Context::getContext()->customer;
|
|
$alert = new SaleAlertMail();
|
|
$alert->id_privatesales = $id_privatesales;
|
|
$alert->id_user = $customer->id;
|
|
$alert->email = $customer->email;
|
|
if($alert->add){
|
|
$this->content = Tools::jsonEncode(array('hasError' => false));
|
|
}else{
|
|
$this->content = Tools::jsonEncode(array('hasError' => true));
|
|
}
|
|
}
|
|
} |