Patrick F Posted September 2, 2022 Share Posted September 2, 2022 Hello, we have a problem when sending emails via the shop system. I hope someone can help me. I found some old threads on this topic, but they always affect all variables, ours specifically only affects HTML links. The thing is that the variables {url} , {shop_url}, {followup} are not replaced by the real links if they are in a <a href="{shop_url}" HTML link. They are only filled by the system in the text field behind it. Example password_query.html The line in the HTML code looks like this: <div style="font-family: Open sans, arial, sans-serif; font-size: 14px; line-height: 25px; text-align: left; color: #363a41;" align="left">Zur Bestätigung klicken Sie bitte auf den folgenden Link: <a href="{url}" target="_blank" style="text-decoration: underline; color: #25b9d7; font-weight: 600;" >{url}</a></div> When the customer receives the mail, he only sees the text line, no clickable link. The code of the email looks like this: <div style=3D"font-family: Open sans, arial, sans-serif; font-size: 14p= x; line-height: 25px; text-align: left; color: #363a41;" align=3D"left">Zur= Bestätigung klicken Sie bitte auf den folgenden Link: <a href=3D"%7Bu= rl%7D" target=3D"_blank" style=3D"text-decoration: underline; color: #25b9d= 7; font-weight: 600;">https://stang-parts.de/passwort-zuruecksetzen?token= =3D202agdhet345354dc133d37db6id_customer=3D28&reset_token=3De73e90= 7001453ge8fb44fc8</a></div> I edited the HTML files with Notepad++ (in UTF8) and uploaded them with WinSCP. There used to be a problem in Prestashop when you edit the mails directly in the system, I found some topics about this. As you can see, the link is in the text, but not in the href html link, where the curly brackets are converted to %7B and %7D. This is the case in all emails with all variables in href links, never in the text. Does somebody has any idea? I looked in the mail.php but can not find the conversion of {url}, only the other variables like {shop_url} if ((Context::getContext()->link instanceof Link) === false) { Context::getContext()->link = new Link(); } $templateVars['{shop_name}'] = Tools::safeOutput($configuration['PS_SHOP_NAME']); $templateVars['{shop_url}'] = Context::getContext()->link->getPageLink( 'index', true, $idLang, null, false, $idShop ); $templateVars['{my_account_url}'] = Context::getContext()->link->getPageLink( 'my-account', true, $idLang, null, false, $idShop ); $templateVars['{guest_tracking_url}'] = Context::getContext()->link->getPageLink( 'guest-tracking', true, $idLang, null, false, $idShop ); $templateVars['{history_url}'] = Context::getContext()->link->getPageLink( 'history', true, $idLang, null, false, $idShop ); $templateVars['{order_slip_url}'] = Context::getContext()->link->getPageLink( 'order-slip', true, $idLang, null, false, $idShop Perhaps still important, we have a multi-shop system. The main shop is in Polish, the server is in Poland, my shop was copied from the main shop and it is german, it has the same theme and email folder. At first there were some problems with the copy of the master data, we have them all solved, except for the email html link problem. I suspect a problem with the different CodePages in Polish and German, but again the problem is only in "href" not in the shown text behind it. I'd be happy for help. Greeting Patrick Frank Link to comment Share on other sites More sharing options...
JBW Posted September 6, 2022 Share Posted September 6, 2022 It is wierd as it looks correct in the source file. Two things to try/check: 1. Replace the html file by the original prestashop one. 2. Check if any override exits e.g. for Mail.php class {url} by the way is filled in the PasswordController. Link to comment Share on other sites More sharing options...
Pete78 Posted July 5, 2024 Share Posted July 5, 2024 Hi, did you find a solution for this since I have the exact same problem. If I debug the Mail class, I see the correct template vars as an argument {url} = https://abc.de.fgh/.... in the anchor href in the mail this is not replaced but between <a..>{url}</a> it is. <a href="{url}" target="_blank" style="text-decoration: underline; color: #25B9D7; font-weight: 600;">{url}</a> so first is not replaced, but second is. I found out, that this only happens with the classic mail theme, but not the modern theme. But, if I compare both, I don't see a significant difference classic: <a href="{url}">{url}</a> to modern: <a href="{url}" target="_blank" style="color:#25B9D7; font-weight:600;">{url}</a> 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