Dan1 Posted September 28, 2019 Share Posted September 28, 2019 How to edit email subject in ps 1.7.6? I know how to edit email body in themes/mytheme/mails/ or in BO translations, but email subject can't be edited in either. In BO - translations - email - subject, there are no expressions to edit. In BO - translations - email - body - core emails I can find the email whose subject I want to change but it also states: No Subject was found for password_query in the database. In this case I want to change the subject of the password reset email. Link to comment Share on other sites More sharing options...
nik Posted October 7, 2019 Share Posted October 7, 2019 +1 Link to comment Share on other sites More sharing options...
Oli4CH Posted October 10, 2019 Share Posted October 10, 2019 (edited) I had similar issues: I translated all email subjects in BO but when I got an email, the subject was still in english. For some reason Prestashop did not use the translations. I do not have any idea why or was able to figure it out. But what I was able, is to hardcode the translation in the file "lang.php" which can be found here: \themes\YOUR_TEMPLATE\mails\YOUR_LANGUAGE\ In the example below you see 2 hardcoded translations. <?php global $_LANGMAIL; $_LANGMAIL = array(); $_LANGMAIL['Your order has been changed'] = 'Ihre Bestellung wurde geändert'; $_LANGMAIL['Product out of stock'] = ''; $_LANGMAIL['Product available'] = ''; $_LANGMAIL['New order : #%d - %s'] = ''; $_LANGMAIL['Stock coverage'] = ''; $_LANGMAIL['New return from order #%d - %s'] = ''; $_LANGMAIL['New credit slip regarding your order'] = 'Gutschrift für Ihre Bestellung'; ?> I hope this helps to solve your issue. Edited October 10, 2019 by Oli4CH (see edit history) 1 Link to comment Share on other sites More sharing options...
taniacr Posted January 15, 2020 Share Posted January 15, 2020 On 10/10/2019 at 2:41 PM, Oli4CH said: I had similar issues: I translated all email subjects in BO but when I got an email, the subject was still in english. For some reason Prestashop did not use the translations. I do not have any idea why or was able to figure it out. But what I was able, is to hardcode the translation in the file "lang.php" which can be found here: \themes\YOUR_TEMPLATE\mails\YOUR_LANGUAGE\ In the example below you see 2 hardcoded translations. <?php global $_LANGMAIL; $_LANGMAIL = array(); $_LANGMAIL['Your order has been changed'] = 'Ihre Bestellung wurde geändert'; $_LANGMAIL['Product out of stock'] = ''; $_LANGMAIL['Product available'] = ''; $_LANGMAIL['New order : #%d - %s'] = ''; $_LANGMAIL['Stock coverage'] = ''; $_LANGMAIL['New return from order #%d - %s'] = ''; $_LANGMAIL['New credit slip regarding your order'] = 'Gutschrift für Ihre Bestellung'; ?> I hope this helps to solve your issue. Perfect! I've been strugling with the d*mn translations for so far! Thank you Link to comment Share on other sites More sharing options...
Dan1 Posted October 11, 2020 Author Share Posted October 11, 2020 (edited) On 10/10/2019 at 9:41 AM, Oli4CH said: I had similar issues: I translated all email subjects in BO but when I got an email, the subject was still in english. For some reason Prestashop did not use the translations. I do not have any idea why or was able to figure it out. But what I was able, is to hardcode the translation in the file "lang.php" which can be found here: \themes\YOUR_TEMPLATE\mails\YOUR_LANGUAGE\ In the example below you see 2 hardcoded translations. <?php global $_LANGMAIL; $_LANGMAIL = array(); $_LANGMAIL['Your order has been changed'] = 'Ihre Bestellung wurde geändert'; $_LANGMAIL['Product out of stock'] = ''; $_LANGMAIL['Product available'] = ''; $_LANGMAIL['New order : #%d - %s'] = ''; $_LANGMAIL['Stock coverage'] = ''; $_LANGMAIL['New return from order #%d - %s'] = ''; $_LANGMAIL['New credit slip regarding your order'] = 'Gutschrift für Ihre Bestellung'; ?> I hope this helps to solve your issue. Thanks but there is no lang,php file at that location. This is an issue that has not been fixed https://github.com/PrestaShop/PrestaShop/issues/9599 Edited October 11, 2020 by Dan1 (see edit history) Link to comment Share on other sites More sharing options...
Emmanuellee Posted October 20, 2020 Share Posted October 20, 2020 Thanks, it worked for me, a question, do you know how I can change or delete this part of the email subject? likewise, I am using version 1.7.6. by prestashop Link to comment Share on other sites More sharing options...
Michi001 Posted January 11, 2021 Share Posted January 11, 2021 On 10/21/2020 at 12:08 AM, Emmanuellee said: Thanks, it worked for me, a question, do you know how I can change or delete this part of the email subject? likewise, I am using version 1.7.6. by prestashop Do you have still a solution for this? Link to comment Share on other sites More sharing options...
Prestachamps Posted January 13, 2021 Share Posted January 13, 2021 Hi, the text inside the parenthesis [XXX] is the shop name, you want to remove the shop names from all the email subjects, or only for one email? If you want to remove for all mails then you can create an override for the Mail.php class, override function send( The subject line is being created in the send function, in this line: $subject = '[' . strip_tags($configuration['PS_SHOP_NAME']) . '] ' . $subject; Kind regards, Leo Link to comment Share on other sites More sharing options...
Michi001 Posted January 13, 2021 Share Posted January 13, 2021 1 hour ago, Leo @ Prestachamps said: If you want to remove for all mails then you can create an override for the Mail.php class, override function send( The subject line is being created in the send function, in this line: $subject = '[' . strip_tags($configuration['PS_SHOP_NAME']) . '] ' . $subject; Hi Leo, yes, i want to remove the website name from all email subjects. Where can i find the mail.php class? In which Folder? I have no experience with override. Maybe it is easier to change the mail.php regards Michael Link to comment Share on other sites More sharing options...
Prestachamps Posted January 13, 2021 Share Posted January 13, 2021 Hi, it is in folder /classes/Mail.php Kind regards, Leo 1 Link to comment Share on other sites More sharing options...
Michi001 Posted January 13, 2021 Share Posted January 13, 2021 31 minutes ago, Leo @ Prestachamps said: it is in folder /classes/Mail.php I have found it! so if i understand right i need to change the line $subject = '[' . strip_tags($configuration['PS_SHOP_NAME']) . '] ' . $subject; to $subject = $subject; ? regards Michael Link to comment Share on other sites More sharing options...
Prestachamps Posted January 13, 2021 Share Posted January 13, 2021 HI, yes, exactly if you want to remove the shopname from the subject, or just comment that line out, as this line is prepending the subject with the [SHOPNAME]. Kind regards, Leo Link to comment Share on other sites More sharing options...
Pandal Posted August 25, 2021 Share Posted August 25, 2021 Maybe it can be useful for someone: if you want to edit the subjects for changed order state emails.. you can't. The subject will be [ShopName] [new_state] so you have to change your state name if you can. 1 1 Link to comment Share on other sites More sharing options...
MinnaLaa Posted April 12, 2022 Share Posted April 12, 2022 On 10/10/2019 at 4:41 PM, Oli4CH said: I had similar issues: I translated all email subjects in BO but when I got an email, the subject was still in english. For some reason Prestashop did not use the translations. I do not have any idea why or was able to figure it out. But what I was able, is to hardcode the translation in the file "lang.php" which can be found here: \themes\YOUR_TEMPLATE\mails\YOUR_LANGUAGE\ In the example below you see 2 hardcoded translations. <?php global $_LANGMAIL; $_LANGMAIL = array(); $_LANGMAIL['Your order has been changed'] = 'Ihre Bestellung wurde geändert'; $_LANGMAIL['Product out of stock'] = ''; $_LANGMAIL['Product available'] = ''; $_LANGMAIL['New order : #%d - %s'] = ''; $_LANGMAIL['Stock coverage'] = ''; $_LANGMAIL['New return from order #%d - %s'] = ''; $_LANGMAIL['New credit slip regarding your order'] = 'Gutschrift für Ihre Bestellung'; ?> I hope this helps to solve your issue. PS 1.7.8.5 (PHP 7.3.33) Where is this lang.php-file that needs to be uploaded? It's not in file directory. Can you upload exact lang.php file here for downloading, please. I've had fresh installalations since PS 1.7.0.0.-1.7.8.5 and no such file can be found in mentioned directory. It would be nice to try it if it works if the file was downloadable somewhere. Thanks Any other solution for this could also be nice. I've read https://github.com/PrestaShop/PrestaShop/issues/9599 Link to comment Share on other sites More sharing options...
Dan1 Posted May 9, 2022 Author Share Posted May 9, 2022 This worked for me in PS 1.7.6: 1. In files modules/ps_emailalerts/ps_emailalerts.php and themes/yourtheme/modules/ps_emailalerts/ps_emailalerts.php Replace: Emails.Subject With: Modules.Emailalerts.Emailsubject There are 5 occurrences, I changed all 5. 2. In ps_emailalerts/mails/en/ and themes/yourtheme/modules/ps_emailalerts/en/ add a lang.php file. I don't know if this step is necessary, I checked the lang.php files afterwards and there was nothing in them. 3. International - translations - installed modules translations - Mail alerts - Language English - Modify - Modules^Emailalerts^Emailsubject - Change: New order : #%d - %s to: YourText #%d - %s Translation will not save if you leave out this part which is the order Reference number: - %s Clear Cache. 1 Link to comment Share on other sites More sharing options...
wop99 Posted May 25, 2022 Share Posted May 25, 2022 I have an issue where I try to edit an email then save it and I get a "Error" page. I also see "No Subject was found for cheque in the database" so I am not sure what to do? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now