Littlepants Posted February 22, 2022 Share Posted February 22, 2022 Can I block an email address from messaging my shop? I frequently (several times a week) receive a SPAM/SCAM email from one email address and it's a fake email address - bounces every time. I just delete them but it's really annoying me now. Link to comment Share on other sites More sharing options...
endriu107 Posted February 23, 2022 Share Posted February 23, 2022 If you use PrestaShop 1.7 you need to edit contactform module. Login to your server by ftp and go to modules/contactform open file contactform.php and after that code: public function sendMessage() { add this: if (Tools::getValue('from') == 'here_email_address@to_block.com') //Change here adress email to spammer email return; 4 Link to comment Share on other sites More sharing options...
hobart Posted May 4, 2022 Share Posted May 4, 2022 Hello If we have more that one email address to be blocked, what code should we use ? Thank you Link to comment Share on other sites More sharing options...
Prestachamps Posted May 4, 2022 Share Posted May 4, 2022 Hi, If you would transform the above example "If" section into an upload able array, could be a temporary solution. You could add a custom section inside the Contactform module to allow you to add the wanted email addresses, and those would be added as extended variables (exceptions). It would take a programmer max 1H. I hope I helped Link to comment Share on other sites More sharing options...
Ress Posted May 4, 2022 Share Posted May 4, 2022 To use multiple emails: $emails_not = array( 'here_email_address@to_block.com', 'here_email_address@to_block.com2', 'here_email_address@to_block.com3' ); if (in_array(Tools::getValue('from'), $emails_not)) return; 1 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