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)); } } }