PrestaShop icon indicating copy to clipboard operation
PrestaShop copied to clipboard

ps_emailalerts - sometimes is missing "mails" folder in specific language

Open ShaiMagal opened this issue 1 year ago • 2 comments

Prerequisites

Describe the bug and add attachments

I don't know, how it happened, but if customer have more languages, sometimes there is specific language missing in folder "mails" in module "ps_emailalers".

And then, mail never arrived, because of missing template in specific language.

I don't have more informations. I don't know how to reproduce, but I was solving this problem about 5 times this year.

Everytime I solved it simple by copying english folder mails to specific language. for example: /modules/ps_emailalerts/mails/en/ -> /modules/ps_emailalerts/mails/sk/

I don't know, how this happened, so I am opening issue for investigating this problem or get to know for future solution.

Expected behavior

"mails" folder in module "ps_emailalerts" should have all languages or use default language if missing language at least.

Steps to reproduce

I don't know how to reproduce this problem :(

PrestaShop version(s) where the bug happened

8.1.7

PHP version(s) where the bug happened

8.1

If your bug is related to a module, specify its name and its version

ps_emailalerts - latest

Your company or customer's name goes here (if applicable).

https://www.openservis.cz/

ShaiMagal avatar Aug 20 '24 22:08 ShaiMagal

Missing email templates are logged in Prestashop log, which is not really used. https://github.com/PrestaShop/PrestaShop/blob/1f260359a26d6cbb615b1d8ac0b79b5eba99d379/classes/Mail.php#L421

@PrestaShop/tech-council I think we just throw an exception when an email template is missing. It's an serious error and this is just silently consuming.

Hlavtox avatar Aug 21 '24 08:08 Hlavtox

Regarding the email template generation, when I test this, when I add a new language, it automatically generates a new folder inside modules/ps_emailalerts/mails/<iso>.

Can you check if the store where you found the bug has content inside mails/themes/modern/modules/ps_emailalerts?

Hlavtox avatar Aug 21 '24 08:08 Hlavtox

@Hlavtox Unfortunately I already fixed it manually same day like I make this post and I don't have backup of this.

I am solving this problem about 4-5x times per year. If I will facing it again, I will provide more details if I don't forget :-D

ShaiMagal avatar Sep 05 '24 19:09 ShaiMagal

Hello @ShaiMagal,

I tried to reproduce your ticket but unfortunately I could not reproduce it.

As I had a language in the BO, the folder is created right away in /modules/ps_emailalerts/mails/.

Thanks.

ingridusta avatar Sep 16 '24 14:09 ingridusta

@ingridusta Like I already wrote I don't know, how this happens.. But I already have this problem for more customers (about 3-4 this year), I don't know what are necessary steps to reproduce this problem :/

ShaiMagal avatar Sep 30 '24 15:09 ShaiMagal

@ingridusta @Hlavtox I reproduced now. (another customer reported problem with no emails arrived) STEPS to reproduce: A) Eshop default language Czech (PS 1.7.8.5, id_lang = 1), B) delete module ps_emailalerts from FTP (or to be sure there isn't) C) Install new module ps_emailalerts from "modules" section D) check /modules/ps_emailalerts/mails/ - there will be missing "cs" folder

Tested 3 times, still same results.

ShaiMagal avatar Oct 21 '24 14:10 ShaiMagal

@ShaiMagal It may be because the mails are generated by the core when updating a language and other actions. And not when installing a module.

Hlavtox avatar Oct 21 '24 16:10 Hlavtox

@Hlavtox OK, but how we will fix this? Or what is the solution? :)

ShaiMagal avatar Nov 25 '24 21:11 ShaiMagal