Include HTML property value in the email

Hi,

Right Now, we run a process to send out an email for our free trial subscriptions including the top 5 updated reports.

We want to include this same process in HubSpot using a contact property where we will include the html code with report information.

The test email showed the html code, instead of the email with the correct format.

Is there a way that we can solve this. The html code will be a dinamic value that will update on daily basis. I tested including only “<p>Hello</p>” and in the email that I received, it showed exactly this code, instead of just “Hello”.

If I used the HTML - Email Content, I can’t associate a value with the existing contact property.

Thanks in advance,

Kale

If you are using a template, you can edit or clone the template so that it renders the HTML properly.

Hi,

I can use a template, but in this template, how can I include a session for the dinamic HTML code.

The HTML code that I need to include change by contacts and by email. I need to include the dinamic HTML code, can I do that?

Thanks

Are you able to resolve this?

Hello @JValonda, happy Friday!

Thank you for posting here!

Could you please share more details of your objective, I would like to tag some experts that might help you :slightly_smiling_face:

Best,

Diana

Yes. Contact properties are available in all templates.

contact

This variable is a dictionary that stores contact personalization properties for a known contact. Properties can be accessed from this dict, by adding a period and the property name. For example, contact.firstname would print the first name of a contact.


Right, I did that. I included a Text object and I associated this with a contact property, but the value of this property is the HTML code. I supposed that HubSpot convertes this HTML code in the plain format when the email is sending, but not. In the email you can see the HTML code.

For example: the property value is:

“<div class=“bcmessage”> <p>Hi Harper,</p><p>ConstructionWire has added/updated <b>new projects</b> matching your coverage. The free trial gives you access to up to five reports which are included below. </p>”

and in the email looks like this, when I supposed to receive something like:

Hi Harper,

ConstructionWire has added/updated new projects …

Make sense. There is any way to do this?

When I included in my template the “HTML - Email” object I can copy and paste the html inside of the HTML box and looks fine, but I need something automatically, because the content of the HTML is dinamic not static information.

Thanks again for your time

Rather than making the email template accept HTML, I recommend adding all of the HTML to the template and only fill in the dynamic fields with the dynamic data.

Template Before:

“<div>{value.emailHTML}</div>”

Template After:

"<div>

<p>Hello, my name is {value.name}.</p>

<p>I am interested in {value.project}.</p>

</div>"

You may also try using the safe filter.