Jump to content

Customer messages are not comingt to e-mail


Recommended Posts

Hello.

 

I am a new user of Prestashop and have almost configured all I needed for start, but can not get this configured:

Customer sends a message through Contact us Form. Everything else works: I see it in my admin panel and get a notification there, but I do not get a notification about new message to my e-mail. Customer gets an automated message that his messages is sent and we will answer soon. 

 

Is there anything I can do?

 

Thanks,

 

Andrus

Edited by Andrus (see edit history)
Link to comment
Share on other sites

Remember to do a backup of file, always!

 

Try this solution:
 

You would edit the ContactController in /controllers/front/
 
Locate the following code

if (!Mail::Send($this->context->language->id, 'contact', Mail::l('Message from contact form').' [no_sync]',
    $var_list, $contact->email, $contact->name, $from, ($customer->id ? $customer->firstname.' '.$customer->lastname : ''),
            $fileAttachment) ||
        !Mail::Send($this->context->language->id, 'contact_form', ((isset($ct) && Validate::isLoadedObject($ct)) ? sprintf(Mail::l('Your message has been correctly sent #ct%1$s #tc%2$s'), $ct->id, $ct->token) : Mail::l('Your message has been correctly sent')), $var_list, $from, null, $contact->email, $contact->name, $fileAttachment))
            $this->errors[] = Tools::displayError('An error occurred while sending the message.');

In that first if statement, you will see the variable $from which is the customers email address.
 
Change $from to null, which will force Prestashop to use the default store email address
if (!Mail::Send($this->context->language->id, 'contact', Mail::l('Message from contact form').' [no_sync]',
    $var_list, $contact->email, $contact->name, null, ($customer->id ? $customer->firstname.' '.$customer->lastname : ''),
            $fileAttachment)

Link to comment
Share on other sites

I did this but nothing changed.

 

Checked and also I do not get an e-mail if anybody makes an order from shop too. So I am wondering maybe I have disabled this somewhere in settings? Could not find this place. I get Notifications in admin panel, but not to e-mail.

Edited by Andrus (see edit history)
Link to comment
Share on other sites

Yes mailalert is installed. It sent me an e-mail when ordered product was out of stock, so strange that some of it works. But no message about new orders.

 

My site is on Maintenance mode at the moment. Can this be the problem? Or it should work even on this mode?

Link to comment
Share on other sites

Problem was that the andru's shop use two languages and the hosting use Suhosin patch for PHP which limits the maximum number of fields allowed in a form 1000 for suhosin.post.max_vars and it give some problems with the translation.

 

The fix that we use in this case is the following:

 

Create a file called php.ini and copy&paste it -> 

suhosin.post.max_vars=4252
suhosin.request.max_vars=4252
max_input_vars=4252

 

and put it in the admin folder of prestashop.

 

Emails works now!  :)

 

PS: Sorry for my makeshift english  :P

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