HubSpot email templates showing raw HTML tags instead of formatted content from contact fields

I’m experiencing an issue with HTML rendering in my HubSpot email templates. I have a rich text property for each contact that stores personalized HTML, but when I pull this content into my email templates, it displays the HTML tags instead of rendering them correctly. What I see is the raw HTML, like <p>Hello there</p><a href="link">Click here</a>, rather than the expected formatted text.

Here’s what I’ve tried:

  • Using the personalization token option
  • Adding {{contact.custom_message}} directly in the template
  • Including it in HTML modules
  • Developing custom HTML templates via Design Tools

Unfortunately, every attempt yields the same results where all HTML tags are visible.

For context, here’s how my contact property looks:

<p>Hello,</p>
<p>Welcome to our service. We're excited to work with you.</p>
<p><a href="https://dashboard.example.com">Access your dashboard</a></p>
<p>Best wishes,</p>
<p>Support Team</p>

Template code that I’m using:

{{contact.custom_message}}

Desired outcome:
Properly formatted paragraphs and active links.

Current outcome:
All HTML tags are displayed as plain text.

Is there a way to enable HubSpot to properly render the HTML instead of displaying it as escaped text?

Yeah, this is a known HubSpot limitation. The platform automatically escapes HTML from contact properties to prevent XSS attacks. I’ve hit this wall multiple times and had to completely restructure my approach. To resolve this, break your HTML content into separate contact properties - one for the main text, another for link URLs, and more for any other dynamic elements. Then rebuild the HTML structure directly in the email template using these individual properties as variables. It’s more tedious than storing complete HTML blocks, but it’s the only method I’ve found that renders consistently across all HubSpot email types.

I encountered a similar issue with HTML tags being escaped in HubSpot email templates. The problem arises because HubSpot sanitizes HTML in contact properties for security reasons, leading to raw HTML being displayed instead of formatted content. I resolved it by avoiding storing HTML in contact properties. Instead, I created standard text properties for dynamic elements, like names and URLs, and constructed the HTML directly in the email template. This way, HubSpot handles the rendering correctly without escaping the tags. It requires some initial setup but effectively eliminates the issue of HTML tags appearing as plain text.

yea, i totally get your frustration, hubspot does that by default since it sees HTML as unsafe. best way is to set up workflows that use separate text fields, then just create your formatting directly in the template with those fields! it might take a bit more work, but itll fix the issue.