Jump to content

BLOCK and email address


Littlepants

Recommended Posts

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;

 

 

  • Like 4
Link to comment
Share on other sites

  • 2 months later...

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

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;

 

  • Like 1
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...