Jump to content

[Solved] Email message every time when customer write a message to me


Recommended Posts

Everytime I post a message to the customer in BO the customer gets email with this message (which is also available in FO if they are logged in) so they are instantly informed about new message. But everytime when customer post a replay or new message for customer suport etc. I as a store owner don't receive any email informing me that new message was posted. So I must go manually into BO (Employees>Customer support or. Orders>Customer massages, etc.) to see if someone is maybe posted a message/question/inquiry for me ... Now I'm wondering, how to make Prestashop to inform me through email when someone post e new message/question/inquiry ... ?? Thank you!

Link to comment
Share on other sites

  • 1 month later...

I just checked the code, if user send a message from order history/order detail page.
PrestaShop does send out email to store owner email address.
So if your store configure connectly, you should be to receive email.

Here is code

                    $message->id_order = (int)($idOrder);
                   $message->private = false;
                   $message->add();
                   if (!Configuration::get('PS_MAIL_EMAIL_MESSAGE'))
                       $to = strval(Configuration::get('PS_SHOP_EMAIL'));
                   else
                   {
                       $to = new Contact((int)(Configuration::get('PS_MAIL_EMAIL_MESSAGE')));
                       $to = strval($to->email);
                   }
                   $toName = strval(Configuration::get('PS_SHOP_NAME'));
                   $customer = new Customer((int)(self::$cookie->id_customer));
                   if (Validate::isLoadedObject($customer))
                       Mail::Send((int)(self::$cookie->id_lang), 'order_customer_comment', Mail::l('Message from a customer'),




Also, id user send message though contact form, you should also be able to receive a email.

Link to comment
Share on other sites

I have checked this OrderDetailController.php file and I could not find any differences from code you posted. I attached this file, can you check it if you will see some problems with it. Because I receive other emails from shop (new order, order confirmation emails, etc.) I persume I have store configured correctly .... Thanks for help!

OrderDetailController.php

Link to comment
Share on other sites

it is difficult to find problem in the code. because you don't know where is the problem, maybe not in code.

I have added some lines to output something information on screen when you send message from order history.
it will display which email address is sent,
it will display is the email is sent or not.

Please use attached file to replace yours (PLEASE make backup of your before doing this)
and make test message, see what will be displayed.

don't forget to restore the file after test.

OrderDetailController.php

Link to comment
Share on other sites

Omg, I'm such a troll ... I had a wrong email in contacts section so now everything makes sense and works now :)) Thank you very much shokinro, it would take a much longer to figure this out without your help (especially your last post) ... ;-)

Link to comment
Share on other sites

  • 1 year later...

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