Jump to content

Block email domain


Recommended Posts

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

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

  • 9 months later...

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...