Bainesarcher Posted April 5, 2020 Share Posted April 5, 2020 Hi, so my prestashop webshop gets maybe 100+ messages EVERYDAY from multiple email addresses which are basically <lots of random numbers>@qq.com the text body is just complete random Chinese writing which when translated means absolutely nothing. Is there a way to totally block the domain qq.com from messaging? Link to comment Share on other sites More sharing options...
NemoPS Posted April 6, 2020 Share Posted April 6, 2020 what's your prestashop version? the file you need to edit depends on it, either the contactform module or contactController. Basically what you do is add a strstr for @qq.com and prevent adding the message if the condition is met Link to comment Share on other sites More sharing options...
Bainesarcher Posted April 6, 2020 Author Share Posted April 6, 2020 my version is 1.6.1.10 Link to comment Share on other sites More sharing options...
NemoPS Posted April 11, 2020 Share Posted April 11, 2020 Then in the postProcess method, inbetween the series of else if, make a new one like else if (strstr($from, '@qq') { $this->errors[] = Tools::displayError('Invalid Email'); } Link to comment Share on other sites More sharing options...
jkenigs Posted February 10, 2021 Share Posted February 10, 2021 Hi Nemo, could you please clarify what to use for 1.7.6? I tried modifying the contactForm module by adding the following in the sendMessage() public function: elseif (strstr($from, '@domainregister') { $this->context->controller->errors[] = $this->trans( 'Invalid Email', [], 'Shop.Notifications.Error'; } Following the logic on your post and the one on the file this seemed correct to me, but made my form unable to load. Thanks in advance, Javier. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now