delete-account-pleas Posted October 5, 2020 Share Posted October 5, 2020 (edited) Affected Prestashop versions: Prestashop 1.7.6+ (This bug is fixed and will be added in prestashop version 1.7.7+)Issue: Emails send to customers showing variables like {firstname} , {lastname}, ...About the error: I have noticed a grow in a specific error on the Prestashop Forums. The error is an issue when automated e-mails are send to your customers they see variables like {firstname} , {lastname} , ... However this is not happening with all emails send to this specific customer. After troubleshooting this issue mainly email templates that are added by modules are affected by this issue. for example: module Contact form (contactform) which sends an order confirmation email to your customer (using email template /yourstore/mails/order_conf.html) is affected by this bug.Why is this error happening?Not all your customers are having this error, and the customers that have this error, only have it with specific emails. The issue is caused by customers who are registered with a email address that is written in CAPITALS. (for example: [email protected]) How to solve this issue?Please note: Normally we will never advice you to edit the core files of Prestashop. However since this is an accepted bug-fix which will be added in Prestashop 1.7.7 and this update will not harm or affect your Prestashop store in no way possible we will, for ONCE, edit a core file. You have to keep in mind when you upgrade your Prestashop version for example from version 1.7.6.1 to 1.7.6.8 you will have to edit this file again. Ok now, AFTER reading all of the above, we will start with editing the file which is causing this issue.1. Open the file: /yourstore/classes/Mail.php 2. Search for "$swift->registerPlugin" or find this code near line 555 (line number depends on which Prestashop version you have)3. Locate following line and quote out using // (two slashes) $swift->registerPlugin(new \Swift_Plugins_DecoratorPlugin(array($toPlugin => $templateVars))); 4. When quoted out the above line place under this line the bug-fix // $swift->registerPlugin(new \Swift_Plugins_DecoratorPlugin(array($toPlugin => $templateVars))); $swift->registerPlugin(new \Swift_Plugins_DecoratorPlugin(array(self::toPunycode($toPlugin) => $templateVars))); 5. Save and test Now we have made the changes ( we have added "self::toPunycode()" ) we can save and close Mail.php. To test if your issue is resolved. 1. Register or alter an e-mail address and make full capitalized (example: [email protected]). 2. Make sure that in the module Contact form "Send confirmation email to your customers" is enabled 3. Make an order with the email with is capitalized (example: [email protected]) 4. Check your e-mail for the order confirmation the variables {firstname}, {lastname}, ... will not be displayed anymore.Did you also had troubles with this issue and did this topic solve it for you? Hit the like button in the right corner 😉 Topic's found where the users are affected by this issue:- How to fix Bonjour {firstname} {lastname}- Paiement accepté: Bonjour {firstname} {lastname}- Mail template don't work ( HALLO {FIRSTNAME} {LASTNAME} )- Why contact_form is showing {firstname} label?- Prestashop V 1.7 - Contact Form - No Name Fields resulting in Email showing "Firstname Lastname" Issue- Prestashop 1.7.6.7 - Variables not replaced in sent emails- PS 1.7.6.4. Customer confirmation eMails without data- Problem with mail variables but only for some members of the team - PS 1.7 Empty template message order confirmation sent to customer - Order Confirmation auto-email not being populated? Edited October 5, 2020 by Crezzur (see edit history) Link to comment Share on other sites More sharing options...
victorglobal Posted October 13, 2020 Share Posted October 13, 2020 On 10/5/2020 at 4:49 PM, Crezzur said: Affected Prestashop versions: Prestashop 1.7.6+ (This bug is fixed and will be added in prestashop version 1.7.7+)Issue: Emails send to customers showing variables like {firstname} , {lastname}, ...About the error: I have noticed a grow in a specific error on the Prestashop Forums. The error is an issue when automated e-mails are send to your customers they see variables like {firstname} , {lastname} , ... However this is not happening with all emails send to this specific customer. After troubleshooting this issue mainly email templates that are added by modules are affected by this issue. for example: module Contact form (contactform) which sends an order confirmation email to your customer (using email template /yourstore/mails/order_conf.html) is affected by this bug.Why is this error happening?Not all your customers are having this error, and the customers that have this error, only have it with specific emails. The issue is caused by customers who are registered with a email address that is written in CAPITALS. (for example: [email protected]) How to solve this issue?Please note: Normally we will never advice you to edit the core files of Prestashop. However since this is an accepted bug-fix which will be added in Prestashop 1.7.7 and this update will not harm or affect your Prestashop store in no way possible we will, for ONCE, edit a core file. You have to keep in mind when you upgrade your Prestashop version for example from version 1.7.6.1 to 1.7.6.8 you will have to edit this file again. Ok now, AFTER reading all of the above, we will start with editing the file which is causing this issue.1. Open the file: /yourstore/classes/Mail.php 2. Search for "$swift->registerPlugin" or find this code near line 555 (line number depends on which Prestashop version you have)3. Locate following line and quote out using // (two slashes) $swift->registerPlugin(new \Swift_Plugins_DecoratorPlugin(array($toPlugin => $templateVars))); 4. When quoted out the above line place under this line the bug-fix // $swift->registerPlugin(new \Swift_Plugins_DecoratorPlugin(array($toPlugin => $templateVars))); $swift->registerPlugin(new \Swift_Plugins_DecoratorPlugin(array(self::toPunycode($toPlugin) => $templateVars))); 5. Save and test Now we have made the changes ( we have added "self::toPunycode()" ) we can save and close Mail.php. To test if your issue is resolved. 1. Register or alter an e-mail address and make full capitalized (example: [email protected]). 2. Make sure that in the module Contact form "Send confirmation email to your customers" is enabled 3. Make an order with the email with is capitalized (example: [email protected]) 4. Check your e-mail for the order confirmation the variables {firstname}, {lastname}, ... will not be displayed anymore.Did you also had troubles with this issue and did this topic solve it for you? Hit the like button in the right corner 😉 Topic's found where the users are affected by this issue:- How to fix Bonjour {firstname} {lastname}- Paiement accepté: Bonjour {firstname} {lastname}- Mail template don't work ( HALLO {FIRSTNAME} {LASTNAME} )- Why contact_form is showing {firstname} label?- Prestashop V 1.7 - Contact Form - No Name Fields resulting in Email showing "Firstname Lastname" Issue- Prestashop 1.7.6.7 - Variables not replaced in sent emails- PS 1.7.6.4. Customer confirmation eMails without data- Problem with mail variables but only for some members of the team - PS 1.7 Empty template message order confirmation sent to customer - Order Confirmation auto-email not being populated? Thanks for the Info, but... I am using PS 1.7.6.4 and I have kind of the same problem with the email: contact_form.html. The difference is that that's the only mail that appears as {firstname} etc. with email accounts using all lower case letters. After applying the mentioned solution of commenting and pasting new code on the Mail.php under classes folder the bug keeps doing its stuff. What could the problem be?, I don't know if anybody had the same problem I am having nor if it is also considered on the next fix... Any info would be appreciated, thanks! Victor. Link to comment Share on other sites More sharing options...
Kami Posted November 2, 2020 Share Posted November 2, 2020 Thank you it's working for me ! Link to comment Share on other sites More sharing options...
lordshop Posted March 30, 2021 Share Posted March 30, 2021 I have the same problem and I try to replace the line. In my 1.7.7.0 mail.php there is a bit different: $swift->registerPlugin(new Swift_Plugins_DecoratorPlugin([self::toPunycode($toPlugin) => $templateVars])); The problem persist and I still got the emails with the variables. Link to comment Share on other sites More sharing options...
Estian Posted May 19, 2021 Share Posted May 19, 2021 @Crezzur You are a legend sir. Thank you for opening this ticket and posting your solution. We've been stuck with this issue for months. Link to comment Share on other sites More sharing options...
chon59 Posted June 18, 2021 Share Posted June 18, 2021 (edited) Hi @Crezzur and everyone would this work on 1.7.5.2 ? Thanks in advance, Edited June 18, 2021 by chon59 (see edit history) Link to comment Share on other sites More sharing options...
delete-account-pleas Posted June 19, 2021 Author Share Posted June 19, 2021 11 hours ago, chon59 said: Hi @Crezzur and everyone would this work on 1.7.5.2 ? Thanks in advance, It will work its a bugfix they always work 😜 Link to comment Share on other sites More sharing options...
Gatto_Rosso Posted June 26, 2022 Share Posted June 26, 2022 Hello, same problem here. Nothing changes after applying patch. PS 1.7.6.5 Order confirmation messages are sent with {variables} both to customer and shop. Email of customer is all lower-case. Everything worked fine until yesterday. No updates/edits were made. 🤔 Any help will be very welcome! Link to comment Share on other sites More sharing options...
Gatto_Rosso Posted June 27, 2022 Share Posted June 27, 2022 Update: all messages are sent with {variables}, including those sent from the Contact form Is there a way to stop this? Link to comment Share on other sites More sharing options...
follettostore Posted July 1, 2022 Share Posted July 1, 2022 On 6/27/2022 at 8:42 AM, Gatto_Rosso said: Update: all messages are sent with {variables}, including those sent from the Contact form Is there a way to stop this? Prestashop 1.7.6.7 Hello, same problem here, from several days ago all was going well then now all variables are not send more in email. no changes are maded in this days to my prestashop. Any idea? Link to comment Share on other sites More sharing options...
Gatto_Rosso Posted July 2, 2022 Share Posted July 2, 2022 Hello, things were fixed updating to PS 1.7.8.6: now email is sent with real text again. The bug affected any email sent: not only order confirmations to both shop and customer but also messages sent from the Contact Us module. Let's hope that the faulty code causing this insane thing was fixed, but I think it works just because the update replaced some file — maybe it will happen again? It would be nice to hear something from the programmers. Best regards Link to comment Share on other sites More sharing options...
kirianjahiem Posted July 18, 2022 Share Posted July 18, 2022 (edited) Thank you for opening this ticket and posting your solution. We've been stuck with this issue for months. https://downloadnox.onl/ https://vidmate.cool/ https://vlc.onl/ Edited July 18, 2022 by kirianjahiem (see edit history) 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