Skip to main content

In my email template, there is a text block, which content is based on a user’s property, let’s call it “description”. The description may or may not contain an HTML link, eg:

<a href="example.com">Example</a>

 and some other plain text. In normal text block, the html is displayed as is, so the user sees the tags and everything.
Is there a way to insert such a user’s property into an email template so that it would be formatted as HTML? So in the given example, user would only see the text “Example”, which would be a link?

Hi @piotrekw,

Welcome to the Community.

Just to clarify, are you looking to work with template tags and dynamic syntax? Has this article helped by chance? 

If not, are you looking to add some hyperlink that is labeled a property? Would love to hear more about how this is being implemented in your emails.

 

Thanks,

Alex


Hi @alex.hong 
We have a custom profile variable that usually contains just a plain text.  I wanted to add it to the email template, so I added it into a text block, like so: 

{{ person|lookup:'short_description' }}

But then I realised than in some cases it can also contain some HTML snippets, usually anchor tags. eg:

Lorem ipsum dolor sit amet, <a href="example.com">consectetur</a>

I wonder if there is a way to display it in the email template with the HTML fragments formatted correctly, and not just treated as a plain text.


Hi @piotrekw ,

Thanks for the response.

Are you running into issues when trying to insert the HTML directly into the Source block of your templates? If you are trying to nest an html link within a custom profile property, that might be where we are running into issues. I will look into this matter and report back as well.

 

Thanks,

Alex


Hi @alex.hong 

Yes, I’m trying to nest an html link within a custom profile property, exactly. If you will be able to find any way to do that, that would be great. Thanks!


Hi @piotrekw,

At the moment I believe there is no way to nest an html link into a property since properties are stored as text values.

Apologies for the inconvenience.


Hi @alex.hong ,
yes, it seems so. For now I’ve started detecting HTML in those texts and removing it before pushing to Klaviyo. Thanks for help :)


Reply