Popular Post delete-account-pleas Posted February 15, 2015 Popular Post Share Posted February 15, 2015 (edited) Hey all, I noticed several people are having issue's when translating or editing templates the url's in the edited e-mail template are broken. When you edited a template url brackets " { " and " } " are replaced by %7B and %7D. Example: {weburl} changes to %7Bweburl%7D How to solve this problem? (Updated 15/07/2015) (This fix works also for cloud based web-shops!) Watch this video for the steps: https://www.youtube.com/watch?v=nwb050tdyfM File used in video: AdminTranslationsController.php Important: after adding this file make sure to clear your cache. This fix will not work unless you have cleared your cache IMPORTANT NOTE: after adding this file you have to replace %7B and %7D. with " { " and " } " (Now they wont change anymore!) Please check every e-mail template you have an issue with that the bracket are not changed. Please note: Issue should disappear with newest version of prestashop: http://forge.prestashop.com/browse/PSCSX-4594?jql= Enjoy your prestashop! ~ Crezzur ~ PS: Don't forget to like my post if this topic has solved your issue Edited August 14, 2015 by Crezzur (see edit history) 22 Link to comment Share on other sites More sharing options...
xrusler Posted February 15, 2015 Share Posted February 15, 2015 Thank you very much for your help! I am going to test is immediately. Link to comment Share on other sites More sharing options...
xrusler Posted February 15, 2015 Share Posted February 15, 2015 Great it works!! Link to comment Share on other sites More sharing options...
delete-account-pleas Posted February 16, 2015 Author Share Posted February 16, 2015 Thank you very much for your help! I am going to test is immediately. Your welcome Link to comment Share on other sites More sharing options...
efrenzy Posted February 26, 2015 Share Posted February 26, 2015 (edited) Thanks for this solution Fast two-liner solution if you are lazy and olso have linux shell access: 1. Copy /themes/THEME_DIR/mails/LANGUAGE_DIR/ to other localisation (for backup if sth goes wrong case). 2. Execute two lines: for i in `ls |grep 'html'`; do echo "Repair: $i" && sed -i "s/%7B/{/g" $i && echo -ne " -DONE- \n"; done for i in `ls |grep 'html'`; do echo "Repair: $i" && sed -i "s/%7D/}/g" $i && echo -ne " -DONE- \n"; done Replace all %7B to { and %7D to } marks. 3. Copy with overriding current .html files. Edited February 26, 2015 by efrenzy (see edit history) 2 Link to comment Share on other sites More sharing options...
mibble Posted February 27, 2015 Share Posted February 27, 2015 I have created account especially to thank to Crezzur. I spent over 3 hours fighting with the issue and only thing I figured out was to to add redundant %7Bkeys%7D => values pairs to template_vars table. Your investigation togheter with sed -i "s/%7D/}/g" ./* in mails html templates diretory is much better. Job done smoothly ! Take care 1 Link to comment Share on other sites More sharing options...
delete-account-pleas Posted February 27, 2015 Author Share Posted February 27, 2015 @mibble Your welcome ;-) Link to comment Share on other sites More sharing options...
ps3z Posted February 28, 2015 Share Posted February 28, 2015 Hey all, I noticed several people are having issue's when translating templates the url's become broken. the brackets " { " and " } " are replaced by %7B and %7D. After a small search i have found what the issue is. I have added a patch for this and going to share it with you guys since it will take a while when there will come a new update for prestashop (i guess). YOUR_WEBSITE_ROOT/controllers/admin/AdminTranslationsController.php Search for: file_put_contents($path.$mail_name.'.'.$type_content, Tools::purifyHTML($content)); Replace that line with: file_put_contents($path.$mail_name.'.'.$type_content, $content); Note: after adding this change you have to replace %7B and %7D. with " { " and " } " (Now they wont change anymore!) Enjoy! And like this post if it helped you so other people can find this fix. Bugreport: http://forge.prestashop.com/browse/PSCSX-4594?jql= i didnt have this problem on 1.6.0.9,its fixed for 1.6.0.13 ? do you know anything about it? 1 Link to comment Share on other sites More sharing options...
ps3z Posted February 28, 2015 Share Posted February 28, 2015 (edited) i found the problem. i edited translation for theme before.i got an error about the logo problem,you have to choose and edite core email templates. http://c2n.me/3dm6y5i.png Edited March 1, 2015 by ps3z (see edit history) Link to comment Share on other sites More sharing options...
delete-account-pleas Posted March 1, 2015 Author Share Posted March 1, 2015 This problem starts with prestashop 1.6.0.11 bug report has been sent so i have no idea if it isbsolved for 1.6.0.133 Link to comment Share on other sites More sharing options...
technico2006 Posted April 1, 2015 Share Posted April 1, 2015 This problem starts with prestashop 1.6.0.11 bug report has been sent so i have no idea if it isbsolved for 1.6.0.133 I did that and it didn't fix my problem, Email links are still not working...can you help? Link to comment Share on other sites More sharing options...
delete-account-pleas Posted April 1, 2015 Author Share Posted April 1, 2015 I did that and it didn't fix my problem, Email links are still not working...can you help? This fix works, did you replace all %7B to { and %7D to } marks. example: %7Bweburl%7D change to {weburl} post your page code here so i can thake a look if you did it right if it still doesnt work Link to comment Share on other sites More sharing options...
lULYS Posted April 1, 2015 Share Posted April 1, 2015 (edited) Hi Crezzur, where i can found this: YOUR_WEBSITE_ROOT/controllers/admin/AdminTranslationsController.php. I have prestashop cloud with ftp account but by FileZilla i can't find these directory. I have this problem in the emails...there are no shop's logo (it's as attached file) and the links in the email don't work. Thanks for your help. P.S. i tried to modify something in the email by my BO of prestashop and it delete me all EN folders about the emails. Edited April 1, 2015 by lULYS (see edit history) Link to comment Share on other sites More sharing options...
delete-account-pleas Posted April 1, 2015 Author Share Posted April 1, 2015 @lULYS can you show a printscreen of your filezilla ? Link to comment Share on other sites More sharing options...
lULYS Posted April 1, 2015 Share Posted April 1, 2015 (edited) Edited April 1, 2015 by lULYS (see edit history) Link to comment Share on other sites More sharing options...
lULYS Posted April 1, 2015 Share Posted April 1, 2015 (edited) when i try to click on a link in the email then appear a blank page with %7B url %7D/ Edited April 1, 2015 by lULYS (see edit history) Link to comment Share on other sites More sharing options...
technico2006 Posted April 1, 2015 Share Posted April 1, 2015 This fix works, did you replace all %7B to { and %7D to } marks. example: %7Bweburl%7D change to {weburl} post your page code here so i can thake a look if you did it right if it still doesnt work do I have to manually replace it on each email? because I didn't do that.. I have just updated the AdminTranslationsController.php file and have replaced classes/Tools.php files my website is www.pandabanana.com.br what do you need to access the code? Link to comment Share on other sites More sharing options...
delete-account-pleas Posted April 1, 2015 Author Share Posted April 1, 2015 do I have to manually replace it on each email? because I didn't do that.. I have just updated the AdminTranslationsController.php file and have replaced classes/Tools.php files my website is www.pandabanana.com.br what do you need to access the code? yes or delete the translated files in your theme folder Link to comment Share on other sites More sharing options...
delete-account-pleas Posted April 1, 2015 Author Share Posted April 1, 2015 when i try to click on a link in the email then appear a blank page with %7B url %7D/ I think its not possible with the cloud version, you will need to wait for the updated version. Link to comment Share on other sites More sharing options...
technico2006 Posted April 1, 2015 Share Posted April 1, 2015 yes or delete the translated files in your theme folder thanks, I didn't know I have to change each one.. I've just tried with one email, and now it works! Link to comment Share on other sites More sharing options...
delete-account-pleas Posted April 2, 2015 Author Share Posted April 2, 2015 thanks, I didn't know I have to change each one.. I've just tried with one email, and now it works! glad you solved it Link to comment Share on other sites More sharing options...
drexdis Posted April 20, 2015 Share Posted April 20, 2015 Hello, i have changed that code in the template, but where can i find the "%7B" and the "%7D"? Thanks Link to comment Share on other sites More sharing options...
delete-account-pleas Posted April 26, 2015 Author Share Posted April 26, 2015 Hello, i have changed that code in the template, but where can i find the "%7B" and the "%7D"? Thanks These can be found in the email templates that you have changed using the email editor. Link to comment Share on other sites More sharing options...
drexdis Posted April 26, 2015 Share Posted April 26, 2015 I thought it would be there so i looked before you said but there is nothing. I attach for example the first email template. how to take screenshots Link to comment Share on other sites More sharing options...
delete-account-pleas Posted April 26, 2015 Author Share Posted April 26, 2015 I thought it would be there so i looked before you said but there is nothing. I attach for example the first email template. how to take screenshots Please note, this error only occurs with e-mail templates you have edited. if you see the brackets { } everything is fine. Link to comment Share on other sites More sharing options...
drexdis Posted April 26, 2015 Share Posted April 26, 2015 When i send emails, i can't click on the links, so i don't think it's ok yet. Link to comment Share on other sites More sharing options...
delete-account-pleas Posted April 26, 2015 Author Share Posted April 26, 2015 When i send emails, i can't click on the links, so i don't think it's ok yet. 1. Locate which e-mail is having the issue: (newsletter, order confirmed, account created, order send, ....) 2. Open the e-mail in your prestashop editor. 3. Edited the %7B with brackets (see image) 1 Link to comment Share on other sites More sharing options...
drexdis Posted April 26, 2015 Share Posted April 26, 2015 Yes man, there it appears. Thanks Link to comment Share on other sites More sharing options...
delete-account-pleas Posted April 26, 2015 Author Share Posted April 26, 2015 Yes man, there it appears. Thanks Your welcome Link to comment Share on other sites More sharing options...
sting5 Posted May 13, 2015 Share Posted May 13, 2015 Big tip for those who struggle to replace %7B and %7D with brackets { } (respectively) in every email template: download any freeware enchanced txt editor (I used Notepad++ for example), go to ../themes/[TEMPLATE NAME]/mails/[the language folder in which links don't work]/ , download all html file templates to separate folder, MAKE BACKUP OF IT! select html file templates (CTRL + A?) and open with the txt editor use "replace with..." function to replace "%7B" with "{" and then "%7D" with "}". Save all files, Upload edited files to the very same folder they were picked from. all this process takes around 2-3 minutes to complete - fast, easy and most important - you will avoid missing some bracket somewhere. 3 Link to comment Share on other sites More sharing options...
delete-account-pleas Posted May 13, 2015 Author Share Posted May 13, 2015 Big tip for those who struggle to replace %7B and %7D with brackets { } (respectively) in every email template: download any freeware enchanced txt editor (I used Notepad++ for example), go to ../themes/[TEMPLATE NAME]/mails/[the language folder in which links don't work]/ , download all html file templates to separate folder, MAKE BACKUP OF IT! select html file templates (CTRL + A?) and open with the txt editor use "replace with..." function to replace "%7B" with "{" and then "%7D" with "}". Save all files, Upload edited files to the very same folder they were picked from. all this process takes around 2-3 minutes to complete - fast, easy and most important - you will avoid missing some bracket somewhere. Well explained Link to comment Share on other sites More sharing options...
Gabs916 Posted May 13, 2015 Share Posted May 13, 2015 I'm not sure if anyone else encountered this, not only does it alter the "{" and "}" upon editing, but In my experience tonight, it also removed the style of the template. My default mail themes had this style: <style> @media only screen and (max-width: 300px){ body { width:218px !important; margin:auto !important; } .table {width:195px !important;margin:auto !important;} .logo, .titleblock, .linkbelow, .box, .footer, .space_footer{width:auto !important;display: block !important;} span.title{font-size:20px !important;line-height: 23px !important} span.subtitle{font-size: 14px !important;line-height: 18px !important;padding-top:10px !important;display:block !important;} td.box p{font-size: 12px !important;font-weight: bold !important;} .table-recap table, .table-recap thead, .table-recap tbody, .table-recap th, .table-recap td, .table-recap tr { display: block !important; } .table-recap{width: 200px!important;} .table-recap tr td, .conf_body td{text-align:center !important;} .address{display: block !important;margin-bottom: 10px !important;} .space_address{display: none !important;} } @media only screen and (min-width: 301px) and (max-width: 500px) { body {width:308px!important;margin:auto!important;} .table {width:285px!important;margin:auto!important;} .logo, .titleblock, .linkbelow, .box, .footer, .space_footer{width:auto!important;display: block!important;} .table-recap table, .table-recap thead, .table-recap tbody, .table-recap th, .table-recap td, .table-recap tr { display: block !important; } .table-recap{width: 295px !important;} .table-recap tr td, .conf_body td{text-align:center !important;} } @media only screen and (min-width: 501px) and (max-width: 768px) { body {width:478px!important;margin:auto!important;} .table {width:450px!important;margin:auto!important;} .logo, .titleblock, .linkbelow, .box, .footer, .space_footer{width:auto!important;display: block!important;} } @media only screen and (max-device-width: 480px) { body {width:308px!important;margin:auto!important;} .table {width:285px;margin:auto!important;} .logo, .titleblock, .linkbelow, .box, .footer, .space_footer{width:auto!important;display: block!important;} .table-recap{width: 295px!important;} .table-recap tr td, .conf_body td{text-align:center!important;} .address{display: block !important;margin-bottom: 10px !important;} .space_address{display: none !important;} } </style> After BO editing, this style was removed. At the moment, In my (Greenhorn) opinion, stay away from back office editing of Email templates, editing the actual files in Notepad++ will guarentee you get the result your looking for. Link to comment Share on other sites More sharing options...
Gregory Roussac Posted May 21, 2015 Share Posted May 21, 2015 Hi, You are right. This might fix this for next release. https://github.com/PrestaShop/PrestaShop/pull/3061/files Regards 1 Link to comment Share on other sites More sharing options...
technico2006 Posted May 24, 2015 Share Posted May 24, 2015 Hi friends, I'm having that problem again... Using prestashop 1.6.0.11 the changes I make are simply not sticking... can anyone please help? My links are still broken Link to comment Share on other sites More sharing options...
delete-account-pleas Posted May 24, 2015 Author Share Posted May 24, 2015 Hi, You are right. This might fix this for next release. https://github.com/PrestaShop/PrestaShop/pull/3061/files Regards Yeah already noticed the bug report is been marked als solved (http://forge.prestashop.com/browse/PSCSX-4594?jql=) https://github.com/PrestaShop/PrestaShop/pull/2728/files The fix is already implemented in 1.6.0.14 so the only version having this issue schould be 1.6.0.9 Hi friends, I'm having that problem again... Using prestashop 1.6.0.11 the changes I make are simply not sticking... can anyone please help? My links are still broken It schould work the files cant change by it self as far as i know. Link to comment Share on other sites More sharing options...
Gabs916 Posted May 25, 2015 Share Posted May 25, 2015 Yeah already noticed the bug report is been marked als solved (http://forge.prestas...PSCSX-4594?jql=) https://github.com/P...pull/2728/files The fix is already implemented in 1.6.0.14 so the only version having this issue schould be 1.6.0.9 I've experienced broken url's and the style being removed on a fresh 1.6.0.14 install, so if it was fixed in 1.6.0.14, im at a loss. Link to comment Share on other sites More sharing options...
ginzaint Posted May 27, 2015 Share Posted May 27, 2015 hey guys , i already figured out this problem. please go to /themes/default-bootstrap/mails/en and then replace all%7D and %7B to { }. and same in mail alert module. that is resolve. i was changing those codes to main mail folder. which i think many of us are replacing those codes to Mail folder which is not in the theme. if any question please post it . i can send you detail information Link to comment Share on other sites More sharing options...
technico2006 Posted May 28, 2015 Share Posted May 28, 2015 (edited) Yeah already noticed the bug report is been marked als solved (http://forge.prestashop.com/browse/PSCSX-4594?jql=) https://github.com/PrestaShop/PrestaShop/pull/2728/files The fix is already implemented in 1.6.0.14 so the only version having this issue schould be 1.6.0.9 It schould work the files cant change by it self as far as i know. Hi, I replaced that line file_put_contents($path.$mail_name.'.'.$type_content, Tools::purifyHTML($content, array('{', '}'))); then I changed classes/Tools.php and controllers/admin/AdminTranslationsController.php files as they were saying here (https://github.com/PrestaShop/PrestaShop/pull/2728/files) I'm unable to change the tools/htmlpurifier/HTMLPurifier.standalone.php file, every time I try to, my website goes offline. With all previous changes I still can't make the url brackets to work, still don't know what is going on in that case. In my older prestashop install those changes worked for me... not it doesn't... EDIT: I managed to change the tools/htmlpurifier/HTMLPurifier.standalone.php and now things seem to work fine, thank you for your reply anyway! Edited May 28, 2015 by technico2006 (see edit history) 1 Link to comment Share on other sites More sharing options...
malice animale Posted May 30, 2015 Share Posted May 30, 2015 (edited) Hi, All my links are broken too. The first answer I saw was to replace the %7B and D by "{" and "}". I changed every mails (sooo long), but for nothing... Then I made the change in the Translation Controller, but it still does not work, the %7 comes again and again. The problem is the same with the logo (see attachement) : I don't see it, and the code is still wrong. I tried also to make the change in the core email templates. Do you know what I'm missing ? Thanks a lot in advance ! ETA : I'm in 1.6.0.14 Edited May 30, 2015 by malice animale (see edit history) Link to comment Share on other sites More sharing options...
malice animale Posted May 30, 2015 Share Posted May 30, 2015 Hi, I replaced that line file_put_contents($path.$mail_name.'.'.$type_content, Tools::purifyHTML($content, array('{', '}'))); then I changed classes/Tools.php and controllers/admin/AdminTranslationsController.php files as they were saying here (https://github.com/PrestaShop/PrestaShop/pull/2728/files) I'm unable to change the tools/htmlpurifier/HTMLPurifier.standalone.php file, every time I try to, my website goes offline. With all previous changes I still can't make the url brackets to work, still don't know what is going on in that case. In my older prestashop install those changes worked for me... not it doesn't... EDIT: I managed to change the tools/htmlpurifier/HTMLPurifier.standalone.php and now things seem to work fine, thank you for your reply anyway! I missed the change proposed by technico2006, I made it, now it works ! I'm relieved I just have to change (again !) all the %7B and %7D, but it seems it is the last time. Thanks to the community help ! Link to comment Share on other sites More sharing options...
sergeyspb2012 Posted June 10, 2015 Share Posted June 10, 2015 Thank you very much. This discussion has really helped. Link to comment Share on other sites More sharing options...
delete-account-pleas Posted June 11, 2015 Author Share Posted June 11, 2015 Thank you very much. This discussion has really helped. Glad to hear that this topic helped you ;-) Link to comment Share on other sites More sharing options...
Hobbes Posted June 20, 2015 Share Posted June 20, 2015 Bonjour à tous et merci à Crezzur pour la résolution de ce petit problème. Petite astuce pour modifier ensuite massivement tous les fichiers mails : Avec Filezilla (ou autre logiciel ftp), télécharger tous les fichiers html du dossier /theme/mail/fr dans un dossier sur votre ordinateur Avec Notepad+, faire CTRL+F et allez dans l'onglet "Rechercher dans les fichiers d'un dossier". Spécifiez le dossier où vous avez téléchargé les fichiers html et faites la recherche %7B à remplacer par { et cliquez sur "Remplacer tout". Faites de même pour %7D par } Tous les fichiers seront modifiés, il n'y a plus qu'à les remettre sur votre FTP. L'opération prends 30 sec. 2 Link to comment Share on other sites More sharing options...
german_martin Posted June 23, 2015 Share Posted June 23, 2015 Hi, This solution only works with Prestashop emails, not for Modules. Modules Emails is getting this error =( I'm using 1.6.0.14 Link to comment Share on other sites More sharing options...
Hobbes Posted June 23, 2015 Share Posted June 23, 2015 Hi, This solution only works with Prestashop emails, not for Modules. Modules Emails is getting this error =( I'm using 1.6.0.14 I suppose you'll just have to do the same within the module mail directories. Link to comment Share on other sites More sharing options...
dlcramer Posted July 5, 2015 Share Posted July 5, 2015 (edited) I am a novice here but I think/thought I understood what I needed to do. I Updated the 3 different php files. Modified just the test.html email originally via the translator area (using notepad++ then uploaded via ftp). Now when I go to send a test email, I get an error to "check my configuration." My updated test email has the standard header and footer of the other emails. The email still sends, but no header or footer on the test email at all. I don't even see the oversized "Hello". Just the "This is a test email, if...." I edited the order_confirm email to be brackets "{ }" but it still delivered with the %7. If I go in as if I wanted to edit the html file in prestashop, Viewing the email shows %7 but html edit, when I go to edit the link is shows as {shop_url} Version 1.6.0.14, with the default bootstrap theme installed using the 1 click install by the host. The email issue is the last thing I am trying to sort out before it goes live. Restored the tool.php to original and the error goes away on sending a test email but of course I still do not have clickable links. Edit: I was able to edit the "send to a friend" with all of the 3 php modules updated and it worked. but now I get an error when adding anything to the shopping cart. Final edit (I hope): I don't know what HTMLPurifier_standalone.php modification is supposed to do, but with it, my site crashes. So far it looks like just the 2 mods fixed my issue. Edited July 6, 2015 by dlcramer (see edit history) Link to comment Share on other sites More sharing options...
juweeltje5 Posted July 15, 2015 Share Posted July 15, 2015 (edited) if i understood correctly, it can't be solved if you use prestashop CLOUD.... so we need to wait until we get a update....correct? juweeltje Edited July 15, 2015 by juweeltje5 (see edit history) Link to comment Share on other sites More sharing options...
delete-account-pleas Posted July 15, 2015 Author Share Posted July 15, 2015 (edited) if i understood correctly, it can't be solved if you use prestashop CLOUD.... so we need to wait until we get a update....correct? juweeltje Update: I have made a video which explains how you can easly fix this error for cloud and self hosted presta webshops. You are not able to access the sub-map your_store_url/Classes/, therefore you cannot apply the update for cloud hosted web-shops. You will have to be patience and wait for the cloud store to upgrade. I am a novice here but I think/thought I understood what I needed to do. I Updated the 3 different php files. Modified just the test.html email originally via the translator area (using notepad++ then uploaded via ftp). Now when I go to send a test email, I get an error to "check my configuration." My updated test email has the standard header and footer of the other emails. The email still sends, but no header or footer on the test email at all. I don't even see the oversized "Hello". Just the "This is a test email, if...." I edited the order_confirm email to be brackets "{ }" but it still delivered with the %7. If I go in as if I wanted to edit the html file in prestashop, Viewing the email shows %7 but html edit, when I go to edit the link is shows as {shop_url} Version 1.6.0.14, with the default bootstrap theme installed using the 1 click install by the host. The email issue is the last thing I am trying to sort out before it goes live. Restored the tool.php to original and the error goes away on sending a test email but of course I still do not have clickable links. Edit: I was able to edit the "send to a friend" with all of the 3 php modules updated and it worked. but now I get an error when adding anything to the shopping cart. Final edit (I hope): I don't know what HTMLPurifier_standalone.php modification is supposed to do, but with it, my site crashes. So far it looks like just the 2 mods fixed my issue. Can you post a printscreen of your e-mail editor, and the e-mail you receive. Edited July 15, 2015 by Crezzur (see edit history) Link to comment Share on other sites More sharing options...
delete-account-pleas Posted July 15, 2015 Author Share Posted July 15, 2015 when i try to click on a link in the email then appear a blank page with %7B url %7D/ If you are still using the cloud based prestashop version you can fix the e-mail error with the new fix i have added. Link to comment Share on other sites More sharing options...
lukx Posted July 17, 2015 Share Posted July 17, 2015 I have the same problem, I can see ugly blue background. but in html it doesn't change { to %7B Link to comment Share on other sites More sharing options...
juweeltje5 Posted July 28, 2015 Share Posted July 28, 2015 Crezzur, it works , even with the could version....exept, one.....; the "Shipped" mail...; even when i change it to }.... is keeps geving me the b7% . Al the rest works fine now Link to comment Share on other sites More sharing options...
delete-account-pleas Posted July 29, 2015 Author Share Posted July 29, 2015 Crezzur, it works , even with the could version....exept, one.....; the "Shipped" mail...; even when i change it to }.... is keeps geving me the b7% . Al the rest works fine now I have just tested "Core emails" -> "shipped" on a clean install of the prestashop version 1.6.0.9 with my solution added and i have no problems changing the brackets of this template without braking the template. are you sure you have replaced the %7b with brackets in that template ? Link to comment Share on other sites More sharing options...
juweeltje5 Posted July 29, 2015 Share Posted July 29, 2015 Yes, when i add a link with {followup} to the "shipped" email template, it keeps opening folwing link : http://%7bfollowup%7d/ Link to comment Share on other sites More sharing options...
oscar-endphasys Posted July 29, 2015 Share Posted July 29, 2015 The problem is that the editor of email templates (the famous TinyMCE), when you edit a link, always replaced in the URL field the characters "{" and "}" to "% 7B" and "% 7D" for hard you try, and always travels URL link wrong because it is not the variable to put the correct URL. The trick is 100% reliable to solve it and that I have solved my problem is this. All email templates are HTML files in the "mail" folder of your template and generic Prestashop. Also you find this folder on the modules that are associated sending emails. Well, like HTML files without more, you can edit them there for not using TinyMCE editor. There you can successfully create URLs of the links, putting well the characters "{" and "}". Then save changes and upload the html file via FTP, substituting there. So, you get to leave the HTML file you want and well done. Link to comment Share on other sites More sharing options...
delete-account-pleas Posted July 29, 2015 Author Share Posted July 29, 2015 Yes, when i add a link with {followup} to the "shipped" email template, it keeps opening folwing link : http://{followup}/ Could you send me a login for you backoffice so i can thale a quick look ? Link to comment Share on other sites More sharing options...
juweeltje5 Posted July 29, 2015 Share Posted July 29, 2015 Could you send me a login for you backoffice so i can thale a quick look ? The problem is that the editor of email templates (the famous TinyMCE), when you edit a link, always replaced in the URL field the characters "{" and "}" to "% 7B" and "% 7D" for hard you try, and always travels URL link wrong because it is not the variable to put the correct URL. The trick is 100% reliable to solve it and that I have solved my problem is this. All email templates are HTML files in the "mail" folder of your template and generic Prestashop. Also you find this folder on the modules that are associated sending emails. Well, like HTML files without more, you can edit them there for not using TinyMCE editor. There you can successfully create URLs of the links, putting well the characters "{" and "}". Then save changes and upload the html file via FTP, substituting there. So, you get to leave the HTML file you want and well done. Well, when i download the "shipped.html" file from FTP, i do see my "followup" link correctly whit {} en no % , but still it dosn't work Link to comment Share on other sites More sharing options...
juweeltje5 Posted July 29, 2015 Share Posted July 29, 2015 Could you send me a login for you backoffice so i can thale a quick look ? you got a PM .... Link to comment Share on other sites More sharing options...
oscar-endphasys Posted July 29, 2015 Share Posted July 29, 2015 I can't send you the login to my backoffice, because in a website for a customer. My solution solved my problem. Perhaps the var "followup" does not exists. Do your other emails run OK? Link to comment Share on other sites More sharing options...
SkynetPremium Posted August 1, 2015 Share Posted August 1, 2015 Hi, Is there any way to do same with "core emails" ?? Though i have edited templates manually , still struggle to enable hyper link for new password generation url & coustomer message reply link in emails sent to coustomer . Also i use version 1,6.0.14 & uploading file AdminTranslationsController is diabling my translations tab from localization menu (back panel of prestashop) i.e when i click translations tab after uploading the file i see blank white page .] Any help is appriciated . Link to comment Share on other sites More sharing options...
Balomy Posted August 5, 2015 Share Posted August 5, 2015 Hi Crezzur, thanks for the solution, but in our case it didn't work. I copied the PHP in the folder /ULR/controllers/admin but afterwards I can't open the translation side in the backoffice of prestashop (version 1.6.014). Just a white screen. So I need to reverse the chances. What went wrong? Kind regards Frank Hey all, I noticed several people are having issue's when translating or editing templates the url's in the edited e-mail template are broken. When you edited a template url brackets " { " and " } " are replaced by %7B and %7D. Example: {weburl} changes to %7Bweburl%7D How to solve this problem? (Updated 15/07/2015) (This fix works also for cloud based web-shops!) Watch this video for the steps: https://www.youtube.com/watch?v=nwb050tdyfM File used in video: AdminTranslationsController.php IMPORTANT NOTE: after adding this file you have to replace %7B and %7D. with " { " and " } " (Now they wont change anymore!) Please check every e-mail template you have an issue with that the bracket are not changed. Please note: Issue should disappear with newest version of prestashop: http://forge.prestashop.com/browse/PSCSX-4594?jql= Enjoy your prestashop! ~ Crezzur ~ PS: Don't forget to like my post if this topic has solved your issue Link to comment Share on other sites More sharing options...
MilkSheikh Posted August 8, 2015 Share Posted August 8, 2015 (edited) Hi all, I used the technique proposed by Crezzur in the youtube video with the override file and it did not work as no matter how hard you try, the %7B url %7D/ would always come back in the email templates. Then I used the other technique: YOUR_WEBSITE_ROOT/controllers/admin/AdminTranslationsController.php Search for: file_put_contents($path.$mail_name.'.'.$type_content, Tools::purifyHTML($content)); Replace that line with: file_put_contents($path.$mail_name.'.'.$type_content, $content); Note: after adding this change you have to replace %7B and %7D. with " { " and " } " (Now they wont change anymore!) This time it worked well for the permanent replacement of %7B and %7D with " { " and " } " However, my shop logo still looks as a broken link in all received emails so that doesnt really help me much and now I still don't have a clue how to fix it PS 1.6.0.14 Edited August 8, 2015 by MilkSheikh (see edit history) Link to comment Share on other sites More sharing options...
MilkSheikh Posted August 8, 2015 Share Posted August 8, 2015 Edit: In classes/Mail.php Replace if (isset($logo)) $template_vars['{shop_logo}'] = $message->attach(new Swift_Message_EmbeddedFile(new Swift_File($logo), null, ImageManager::getMimeTypeByExtension($logo))); By : if (isset($logo)) $template_vars['{shop_logo}'] = Tools::getShopDomain(true, true).__PS_BASE_URI__.'img/'.Configuration::get('PS_LOGO', null, null, $id_shop); Your logo won't be in attachement anymore and will be in the header of the emails. After that you still need to replace manually all the %7B and %7D with " { " and " } " in the email templates. So if anyone has a trick for a quick mass edit I am up for it Cheers ! Link to comment Share on other sites More sharing options...
delete-account-pleas Posted August 9, 2015 Author Share Posted August 9, 2015 Hi all, I used the technique proposed by Crezzur in the youtube video with the override file and it did not work as no matter how hard you try, the %7B url %7D/ would always come back in the email templates. Then I used the other technique: YOUR_WEBSITE_ROOT/controllers/admin/AdminTranslationsController.php Search for: file_put_contents($path.$mail_name.'.'.$type_content, Tools::purifyHTML($content)); Replace that line with: file_put_contents($path.$mail_name.'.'.$type_content, $content); Note: after adding this change you have to replace %7B and %7D. with " { " and " } " (Now they wont change anymore!) This time it worked well for the permanent replacement of %7B and %7D with " { " and " } " However, my shop logo still looks as a broken link in all received emails so that doesnt really help me much and now I still don't have a clue how to fix it PS 1.6.0.14 Did you clear your cache after my suggested fix ? Link to comment Share on other sites More sharing options...
MilkSheikh Posted August 9, 2015 Share Posted August 9, 2015 Hi, Yes I did but it didn't work. Anyway I still managed to do it afterwards but now looking for a quick edit way to replace all %7B and %7D with " { " and " } " Link to comment Share on other sites More sharing options...
aus920 Posted August 14, 2015 Share Posted August 14, 2015 I did that and it didn't fix my problem, Email links are still not working...can you help? I know this might be coming a little bit late but I still felt I should post it as I have been battling this problem for over 3 months now. Tried the fix above to no avail. I actually thought I have replaced all the %7B and %7D until moments ago when I accidentally looked at the "image" link on the "Edit HTML version" tab of the email templates and realised that the "{" and "}" have also been replaced with %7B and %7D. I changed these back to the normal "{" and "}" and bingo - problem solved. I am so happy. Thanks to all contributors. Link to comment Share on other sites More sharing options...
123Kirill312 Posted August 14, 2015 Share Posted August 14, 2015 (edited) Hi, Doesnt work for me, unfortunately... I add this file and changed {} three times. Version 1.6.0.14 Regards, Edited August 14, 2015 by 123Kirill312 (see edit history) Link to comment Share on other sites More sharing options...
delete-account-pleas Posted August 14, 2015 Author Share Posted August 14, 2015 Hi, Doesnt work for me, unfortunately... I add this file and changed {} three times. Version 1.6.0.14 Regards, Did you clear your cache before changing the template? Link to comment Share on other sites More sharing options...
123Kirill312 Posted August 15, 2015 Share Posted August 15, 2015 Hi Crezzur, Yes, I cleared the Cache before and after, only before, and only after. Regards, Kirill Link to comment Share on other sites More sharing options...
123Kirill312 Posted August 15, 2015 Share Posted August 15, 2015 (edited) PS I also cleared cache manualy... I don't know how to solve it. It is really a huge problem. And I can't update the version. Too much of editing. Edited August 15, 2015 by 123Kirill312 (see edit history) Link to comment Share on other sites More sharing options...
123Kirill312 Posted August 16, 2015 Share Posted August 16, 2015 MilkSheikh, Thank you VERY MUCH! You helped me a lot! This works for me: YOUR_WEBSITE_ROOT/controllers/admin/AdminTranslationsController.php Search for:file_put_contents($path.$mail_name.'.'.$type_content, Tools::purifyHTML($content));Replace that line with:file_put_contents($path.$mail_name.'.'.$type_content, $content);Note: after adding this change you have to replace %7B and %7D. with " { " and " } " (Now they wont change anymore!) 1 Link to comment Share on other sites More sharing options...
MilkSheikh Posted August 16, 2015 Share Posted August 16, 2015 You re welcome 123Kirill312, happy you managed it. But I think this solution was proposed by Crezzur first, I just copied it. So all praises to him 1 Link to comment Share on other sites More sharing options...
123Kirill312 Posted August 17, 2015 Share Posted August 17, 2015 Yes, and many thanks to Crezzur, two weeks of work and was no solution but now I am happy and everything works fine! Thank you! PS But still Logo is in the attachment Regards, Kirill Link to comment Share on other sites More sharing options...
MilkSheikh Posted August 17, 2015 Share Posted August 17, 2015 Did you try that for logo in attachement ? It worked for me: In classes/Mail.php Replace if (isset($logo)) $template_vars['{shop_logo}'] = $message->attach(new Swift_Message_EmbeddedFile(new Swift_File($logo), null,ImageManager::getMimeTypeByExtension($logo))); By : if (isset($logo)) $template_vars['{shop_logo}'] = Tools::getShopDomain(true, true).__PS_BASE_URI__.'img/'.Configuration::get('PS_LOGO', null, null, $id_shop); Link to comment Share on other sites More sharing options...
delete-account-pleas Posted September 24, 2015 Author Share Posted September 24, 2015 (edited) If someone tried the fix but gives no solution post a message here, I can provide a team-viewer session to solve your problems. Edited September 24, 2015 by Crezzur (see edit history) Link to comment Share on other sites More sharing options...
clubvapea Posted October 5, 2015 Share Posted October 5, 2015 Thanks, works perfect! Link to comment Share on other sites More sharing options...
delete-account-pleas Posted October 5, 2015 Author Share Posted October 5, 2015 Thanks, works perfect! Your welcome ;-) Link to comment Share on other sites More sharing options...
Saiff Posted October 18, 2015 Share Posted October 18, 2015 (edited) Hi there, i have a problem with this solution... i am on prestashop version 1.6.0.11 And i downloaded the AdminTranslationsController.php, i put it in the right folder under my ftp... But now when i click on "Edit the HTML version" on my mail, it's like that : I'm not able to Display mails in html format.... What can i do to be able to see the HTML format again ? Thank you. Edited October 18, 2015 by Saiff (see edit history) Link to comment Share on other sites More sharing options...
delete-account-pleas Posted October 19, 2015 Author Share Posted October 19, 2015 Hi there, i have a problem with this solution... i am on prestashop version 1.6.0.11 And i downloaded the AdminTranslationsController.php, i put it in the right folder under my ftp... But now when i click on "Edit the HTML version" on my mail, it's like that : I'm not able to Display mails in html format.... What can i do to be able to see the HTML format again ? Thank you. Send me your original AdminTranslationsController.php located here -> yourwebshop/controllers/admin/AdminTranslationsController.php I will make a custom override for you and see if this works. Link to comment Share on other sites More sharing options...
delete-account-pleas Posted November 17, 2015 Author Share Posted November 17, 2015 @Balomy I think you have placed your file in the wrong location, you have placed the file in your override folder right ? Otherwhile it wont work Link to comment Share on other sites More sharing options...
meimei Posted November 19, 2015 Share Posted November 19, 2015 hi i hope someone could help me on this issue, i went to BO to change email subject at translation for email template, and after i clicked SAVE, it all gone haywire. I will receive email in cyan background and my shop logo will not display in the template but in attachment. I think it's a common bug as i have seen many reported cases like that but no one seems to have a solution yet. Can someone help me? I am using PS1.6.1.2 Link to comment Share on other sites More sharing options...
delete-account-pleas Posted November 19, 2015 Author Share Posted November 19, 2015 hi i hope someone could help me on this issue, i went to BO to change email subject at translation for email template, and after i clicked SAVE, it all gone haywire. I will receive email in cyan background and my shop logo will not display in the template but in attachment. I think it's a common bug as i have seen many reported cases like that but no one seems to have a solution yet. Can someone help me? I am using PS1.6.1.2 I could help but then i will need a login to your backoffice to see whats going on. Link to comment Share on other sites More sharing options...
Guix69 Posted November 28, 2015 Share Posted November 28, 2015 (edited) Hi, some can tell me why i don't have the AdminTranslationsController.php file in the overdrive folder like in the video ? I try to fix manually : file_put_contents($path.$mail_name.'.'.$type_content, $content); It's working, now notepad++ for all the mail. Thanks Edited November 28, 2015 by Guix69 (see edit history) Link to comment Share on other sites More sharing options...
delete-account-pleas Posted November 28, 2015 Author Share Posted November 28, 2015 Hi, some can tell me why i don't have the AdminTranslationsController.php file in the overdrive folder like in the video ? I try to fix manually : file_put_contents($path.$mail_name.'.'.$type_content, $content); It's working, now notepad++ for all the mail. Thanks you have to download the file in the first topic and place it into the override folder, it normal its not inside the override folder. Link to comment Share on other sites More sharing options...
Guix69 Posted November 28, 2015 Share Posted November 28, 2015 Ah ok ^^ but i did the first solution. So it's working great Just have to replace all %7B and D in the module mail too Link to comment Share on other sites More sharing options...
delete-account-pleas Posted November 28, 2015 Author Share Posted November 28, 2015 Ah ok ^^ but i did the first solution. So it's working great Just have to replace all %7B and D in the module mail too Great it worked ;-) the override folder allows people to make core changes which doesn't harm your web shop when your upgrading to the latest prestashop version Link to comment Share on other sites More sharing options...
EXCORP Posted December 17, 2015 Share Posted December 17, 2015 OK so I tried this.. After I loaded the new fle to replace the other - I was no longer able to access Translations in the back office. Got "Server Error" ANY solution for this? Not being able to save these url prarameters is driving me bonkers Link to comment Share on other sites More sharing options...
delete-account-pleas Posted December 22, 2015 Author Share Posted December 22, 2015 OK so I tried this.. After I loaded the new fle to replace the other - I was no longer able to access Translations in the back office. Got "Server Error" ANY solution for this? Not being able to save these url prarameters is driving me bonkers What prestashop version are you using? What actions did you do ? Post the full error. Link to comment Share on other sites More sharing options...
BabyMonkey Posted February 11, 2016 Share Posted February 11, 2016 Hi, i've this problem with Prestashop 1.6.0.14, but it's not solved with your tutorial. Can be my server the problem? somone writes there are problems with magic quotes, but I've PHP 5.5.31, and magic quotes are deleted.... Link to comment Share on other sites More sharing options...
simchgab Posted June 10, 2017 Share Posted June 10, 2017 Hi, You are right. This might fix this for next release. https://github.com/PrestaShop/PrestaShop/pull/3061/files Regards The same error are in the prestashop 1.7.1.1 and 1.7.1.2 grrrrr Link to comment Share on other sites More sharing options...
nbexiga Posted January 16, 2018 Share Posted January 16, 2018 Hi i have prestashop 1.7.1.1 but the issue is the same... in the editor i see the {} but in the html preview i see the %7D and when i edit the html link in prestashop it shows the {} and i cannot find any %7D related.. can some one help ? Link to comment Share on other sites More sharing options...
nbexiga Posted January 16, 2018 Share Posted January 16, 2018 On 29/07/2015 at 9:24 AM, oscar-endphasys said: The problem is that the editor of email templates (the famous TinyMCE), when you edit a link, always replaced in the URL field the characters "{" and "}" to "% 7B" and "% 7D" for hard you try, and always travels URL link wrong because it is not the variable to put the correct URL. The trick is 100% reliable to solve it and that I have solved my problem is this. Hi i have prestashop 1.7.1.1 but the issue is the same... in the editor i see the {} but in the html preview i see the %7D and when i edit the html link in prestashop it shows the {} and i cannot find any %7D related.. can some one help ? All email templates are HTML files in the "mail" folder of your template and generic Prestashop. Also you find this folder on the modules that are associated sending emails. Well, like HTML files without more, you can edit them there for not using TinyMCE editor. There you can successfully create URLs of the links, putting well the characters "{" and "}". Then save changes and upload the html file via FTP, substituting there. So, you get to leave the HTML file you want and well done. Link to comment Share on other sites More sharing options...
simchgab Posted January 16, 2018 Share Posted January 16, 2018 I solve the problem, with prestashop 1.7.2 and, delete the htaccess in the folder mail. And uploading the store in a hosting. Link to comment Share on other sites More sharing options...
nbexiga Posted January 16, 2018 Share Posted January 16, 2018 13 minutes ago, simchgab said: I solve the problem, with prestashop 1.7.2 and, delete the htaccess in the folder mail. And uploading the store in a hosting. Hi , but i cannot upgrade to presta 1.7.2 because i already tried and did not work the update... how can i fix in this version of prestashop? only delete the htaccess in the folder email? Link to comment Share on other sites More sharing options...
simchgab Posted January 16, 2018 Share Posted January 16, 2018 (edited) 5 hours ago, nbexiga said: Hi , but i cannot upgrade to presta 1.7.2 because i already tried and did not work the update... how can i fix in this version of prestashop? only delete the htaccess in the folder email? Yo elimine el htaccess de la carpeta mail, desactive ModSecurity en el servidor (Me trae problemas de redirecciones y no se hasta que punto no me afecto en los mails) Y si estas en localhost, prueba en un hosting gratuito a ver si tenes el mismo problema. (Te adjunto imagen de mi carpeta mails) Incluso eliminando el archivo htaccess, también solucione un problema que tenía que no me abria el visor de mails en los estados, Edited January 16, 2018 by simchgab (see edit history) Link to comment Share on other sites More sharing options...
nbexiga Posted January 17, 2018 Share Posted January 17, 2018 Hi i am not in local host. it's in local host because i downloaded the files to local host for can change. the delete of htaccess does not work ;/;/;/ Link to comment Share on other sites More sharing options...
Patrick F Posted August 31, 2022 Share Posted August 31, 2022 On 1/17/2018 at 4:09 PM, nbexiga said: Hi i am not in local host. it's in local host because i downloaded the files to local host for can change. the delete of htaccess does not work ;/;/;/ Do you find a solution for this problem? I have exactlly the same in prestashop 1.7.8.6 and don`t find a solution. 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