Jump to content
  • 0

URL Variables in Email Template Not Working


felguard

Question

Hi,

 

In the emails that are sent to customers, only the non-URL variables work. For example, {shop_url} works will if left as is. Meaning, it'll change into the url of my shop when it's not made into a link. However, when I try to insert {shop_url} as a link, the {shop_url} will stay as {shop_url} in the email and not change into my actual shop URL.

 

When I add {shop_url} as regular text, it changes to my www.shopurl.com in the email. It's only when I insert a link into it that the {shop_url} doesn't change.

 

For example, if I type "HELLO" and insert the link {shop_url}, in the email sent, the word HELLO becomes a link. But instead of it link to my actual shop URL, it only links to {shop_url}. In the picture, my mouse is over the word HELLO. post-958121-0-10372100-1426670982_thumb.jpg

 

Sorry, if I didn't explain this well. Please let me know if you want me to expand on it.

 

I'm using the latest version of the cloud by the way.

 

Thank you.

post-958121-0-89088200-1426670997_thumb.jpg

Link to comment
Share on other sites

16 answers to this question

Recommended Posts

  • 0

But that's the thing, I wasn't using the feature like that. The feature came like that from Prestacloud. So why would they use a feature incorrectly like that? For example, the footer on the bottom of all email templates have the {shop_name} powered by PrestaShop where {shop_name} is a link to {shop_url}.

Link to comment
Share on other sites

  • 0

Wow, okay so I have a separate store that's not hosted on the cloud and the email template variables work fine without a problem.

 

The {shop_url} links all automatically change to my store domain when the email is sent.

 

So I don't know if the problem lies with just cloud or what not, but this is ridiculous.

Edited by felguard (see edit history)
Link to comment
Share on other sites

  • 0

Wow, okay so I have a separate store that's not hosted on the cloud and the email template variables work fine without a problem.

 

The {shop_url} links all automatically change to my store domain when the email is sent.

 

So I don't know if the problem lies with just cloud or what not, but this is ridiculous.

Have you solved it ?

Link to comment
Share on other sites

  • 0

Have you solved it ?

No, I haven't.

 

I think when if you have a new store on the cloud, the email url variables will work fine. However, once you edit/change anything in there, the variables stop working. So, I think if you want to make changes to it, you have to manually edit the files via FTP so that the url variables will still continue working. I'm not 100% sure it'll work, but you could give it a try. Good luck.

Link to comment
Share on other sites

  • 0

I'll re-built again all my website but in local host....i don't want have anymore the cloud version !!

Now i have to take a difficult decision : choose the best web hosting. i don't know how to choose it for my ecommerce with about 300/400 products...there are hosting with dedicated server but they are expansive and mant times don't work perfectly ! 

Link to comment
Share on other sites

  • 0

I'll re-built again all my website but in local host....i don't want have anymore the cloud version !!

Now i have to take a difficult decision : choose the best web hosting. i don't know how to choose it for my ecommerce with about 300/400 products...there are hosting with dedicated server but they are expansive and mant times don't work perfectly ! 

Yeah, if I could go back in time I'd probably have my store on a local host instead of doing the cloud.

Link to comment
Share on other sites

  • 0

Hi,

 

Just to confirm your suspicions I also have had the same problem as a result of editing an email the "proper way" through Localisation > Translations > emails etc.

 

All variables work fine in the actual text of the email but anything within the HTML (even if entered using the view source button) ends up with URL encoded curly brackets no matter what you do.

 

So all the links should read <a href="{shortcut}">link</a>

 

but they are all showing:

 

<a href="%7Bshortcut%7D">link</a>

 

A bit of a stupid bug to be completely honest but cloud is littered with them!

 

I could fix this by find and replace on the files (%7B for { etc.) but that isn't the point really.

 

 

EDIT - just also to mention that both textwrangler and Brackets will let you mass find and replace the %7D and %7B in multiple files and then save them all back via FTP

Edited by fgh (see edit history)
Link to comment
Share on other sites

  • 0
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% sure 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 by FTP, substituting there. So, you get to leave the HTML file you want and well done.
Link to comment
Share on other sites

  • 0

Hello!!

This post is very old but I fix it doing other thing. If someboby want to check other solution for the image of logo don't attachment on email, you can do so this.

For example, if you want change your custom logo just for one mail template, you have to maintenance the image original from {shop_logo} with this code:

 <!--This is the original code on any email template-->
<tr>
  <td>
    <a href="{shop_url}">
      <img src="{shop_logo}">
    </a>
  </td>
</tr>

Just you have to hidde the image original on div, span o another element, don't care:

<tr>
  <td>
    <a href="{shop_url}">
        <!--This is your custom logo-->
    	<img src="yourCustomLogoUrl">
    
      	<!--This is the original logo but hidden-->
    	<span style="display:none">
      	<img src="{shop_logo}">
	</span>
    </a>
  </td>
</tr>

I read the code of classes/mail.php and if can't found the image {shop_logo} on template, the sistem attachment image logo to email.

This works fine for me. My version is Prestashop 1.7.6.

I hope that this solution can be serve to anybody.

Regards.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...