Jump to content

[SOLVED] Admin Mail Alert for new order not working


ravenmeisje

Recommended Posts

I use Prestashop Classic theme and 1.7.5 and I installed and configured the mail alerts module to be able to receive e-mails when I get new orders in. But I do not receive these emails when I get a new order in.

I already checked the ps_emailalerts/mails folder to see if there was a folder with my language and yes, the NL language folder does exist already, next to the EN folder, so that does not seem to be the problem. But then, what is? Does anyone know? I configured the module to "yes" where asked if I want to receive e-mails when a new order comes in. I also tried configuring it to "No", saving it, and configuring it back to "yes" again, and safe again. It didn't help.

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

Hi JBW, thanks for your questions! Yes, the NL folder has the same number of files as the EN folder. How do I check if the email address used for the notification is registered in a usr account with one of the languages? I think I have it configured correctly but am not entirely sure if I understand you correctly.

I also found out that I do not get an email notification when someone uses the contact form. The customer does get a confirmation email about this, but I as an admin, don't. Even though I have the contact form module configured as "would like to receive email confirmation as an admin if a customer uses the contact form". So when I saw this error, I went into E-mail settings and tried sending a test e-mail to myself. That does not arrive as well.

I have my email settings listed as "php mail () function" and allow both html and text emails.

Maybe with this extra info you can help me even more?

Link to comment
Share on other sites

Also, if I do a test order, the customer does receive all emails, so there's nothing wrong with the sending of e-mails to my customers, only mail alerts to me as an admin and the email that should be sent to me when a customer uses the contact form..

Link to comment
Share on other sites

As said the ps_mailalert module checks the assigned receiver addresses. If there is a admin user with the same email it takes the language from this user profile to get the mail template. Not sure if contact form is using similar logic. So i would check first if your receiver email/s have another language than NL or EN in user profiles.

          $mail_id_lang = $id_lang;
            $mail_iso = $iso;

            // Use the merchant lang if he exists as an employee
            $results = Db::getInstance()->executeS('
				SELECT `id_lang` FROM `'._DB_PREFIX_.'employee`
				WHERE `email` = \''.pSQL($merchant_mail).'\'
			');
            if ($results) {
                $user_iso = Language::getIsoById((int) $results[0]['id_lang']);
                if ($user_iso) {
                    $mail_id_lang = (int) $results[0]['id_lang'];
                    $mail_iso = $user_iso;
                }
            }

 

Link to comment
Share on other sites

Ok, thanks. I checked the employees settings and the SuperAdmin uses the gmail email address I use for everything in my shop, and also the language is set to NL. I switched it to EN and tried the contact form again, but still no email for admin. The test email still did not work either when SuperAdmin language is set to EN. I only have EN en NL set up as languages in my shop, and those are the only options available when I look at the employee settings.

Also, the emails do show up in the Advanced Parameters/Emails as "new message received through the contact form". They just don't get forwarded to the gmail address I added :(

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

  • 7 months later...
On 3/6/2019 at 1:20 PM, JBW said:

As said the ps_mailalert module checks the assigned receiver addresses. If there is a admin user with the same email it takes the language from this user profile to get the mail template. Not sure if contact form is using similar logic. So i would check first if your receiver email/s have another language than NL or EN in user profiles.


          $mail_id_lang = $id_lang;
            $mail_iso = $iso;

            // Use the merchant lang if he exists as an employee
            $results = Db::getInstance()->executeS('
				SELECT `id_lang` FROM `'._DB_PREFIX_.'employee`
				WHERE `email` = \''.pSQL($merchant_mail).'\'
			');
            if ($results) {
                $user_iso = Language::getIsoById((int) $results[0]['id_lang']);
                if ($user_iso) {
                    $mail_id_lang = (int) $results[0]['id_lang'];
                    $mail_iso = $user_iso;
                }
            }

 

Hi JBW, I have the same problem. Where can I find this code? Many thanks!

Link to comment
Share on other sites

Hi,

I have the same problema but only on new_order.

Mail alert works well on everything (user email, confirmation email, etc.) but I do not receive admin emails when I get a new order in.

I did all the checks in this post but it still doesn't work. Any suggestions?

Many thanks!

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

I have two presta sites and this problem started occuring on one of them for no clear reason. Test email and all other email works perfectly, but email notifying merchant of a sale fails and is not registered in the sent email list. If test email to the merchant works then why does it fail for a sale notification? It looks like a failure in the notifications module rather than the email system.

Link to comment
Share on other sites

  • 1 year later...

Hey Guys!

 

I got the same Problem.
All mails are sent as they shoudl, except the new_order mail of ps_emailalerts.

I tried and checked everything from above but nothing worked. I use PS v 1.7.6.7
I already created several prestashops with this module and never had a problem.
It already worked with the current project but about a month ago it stopped sending the mails as far as i can tell from the mailhistory of prestashop.

I don't know of anything critical that changed, i barely remember any change at all since this project is live for quite some time now.

The modules version is 2.2.1 but already tried 2.2.2 as well.

If anyone got any other idea on why the new_order mail might run into an error just tell me pls.

I'm totally out of ideas at this point and sadly the log is empty light a desert.

 

Thanks in advance of your answer.

Link to comment
Share on other sites

  • 2 months later...
  • 3 weeks later...
  • 3 weeks later...

I'm also experiencing the same problem since one month ago. It used to work and suddenly stopped. new_order isn't in email log anymore since last month that used to work without issues. Email settings are correct because if i use the "Test email" section, it sends email without problem. I tried to reinstall the Mail Alerts module (v 2.3.0), it didn't work. I installed an older version of the module (v 2.2.1), it didn't work either. I don't know what else to try.

PS version: 1.7.6.4

 

Link to comment
Share on other sites

3 hours ago, SIWA_Fabian said:

For me the issue was solved when i moved the mail-templates to my child theme.

 

Somehow prestashop look in the wrong directory for the files, didn't find any and therefore couldn't send the mail.

OMG! That was it! Thank you so much for sharing Fabian! This solved my issue as well. I couldn't think of it because it used to work a month ago. Maybe after the update to 2.3.0 they changed the folder path. Again thank you! 🙂

Link to comment
Share on other sites

  • 2 months later...
En 30/7/2021 a las 10:27 AM, sakis_s dijo:

OMG! That was it! Thank you so much for sharing Fabian! This solved my issue as well. I couldn't think of it because it used to work a month ago. Maybe after the update to 2.3.0 they changed the folder path. Again thank you! 🙂

Hi, could you explain the solution? Thanks

Link to comment
Share on other sites

  • 2 months later...

On 10/18/2021 at 11:09 AM, Fran said:

Hi, could you explain the solution? Thanks

On 7/30/2021 at 10:54 AM, San75 said:

Can you please post a guide how to do the above?

Hi guys, check if you have the email templates in the right folder (modules > ps_emailalerts or whatever the name of the module is >>  mails >> your language...

Mine was showing the files but all were empty when opened. If you see the templates and files aren't blank...and it still doesn't work, you can also try to copy the email templates to module folder of your theme, which is what guys above are refering to (I guess). I did both and it worked for me :)

  • Like 1
Link to comment
Share on other sites

  • 4 months later...

Tenía el mismo problema y lo he solucionado reinicianizando el módulo de mail alert. Al reinicializarlo me daba el error

PHP Fatal error: Cannot use result of built-in function in write context in /usr/share/php/Archive/Tar.php on line 639

Hice los cambios del siguiente enlace, reinicialicé el módulo de mail alert y ya funciona sin problema.

https://gist.github.com/aamsur-mkt/cd0febddc262f54385e7bd4a2d91df31

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