class ContactController extends ContactControllerCore { public function postProcess() { if(Tools::isSubmit('submitMessage')) { $message = Tools::getValue('message'); $from = Tools::getValue('from'); $banned_in_email = ['.ru', 'qq.com', '.vn']; $banned_content = ['email marketing']; foreach ($banned_in_email as $string) { if(strstr($from, $string)) $this->errors[] = Tools::displayError('This email address is not allowed'); } foreach ($banned_content as $string) { if(strstr($message, $string)) $this->errors[] = Tools::displayError('Invalid Content'); } } parent::postProcess(); } }