Can you reference custom properties in hubspot emails (source code)


Hi there,

In order to get started with product reviews in Trustpilot, I need to BCC or send directly to our Trustpilot email address with the following script in the header html of the email:

<script type="application/json+trustpilot">
"recipientName": "Name MacNameson",
"recipientEmail": "",
"referenceId": "1234abcd",
"productSkus": ["ABC-1234","ABC-4321"]


These values will need to by dynamic based on custom properties for each contact. I have already et up the custom properties. So i am just wondering how to reference the custom properties in the code editor


Welcome, @a.ayodeji.

Yes, this is possible. I just confirmed the following method populates a contact's property values:

  1. To modify a HubSpot marketing email's <head> source code, you must clone a template to HTML. (The screenshots in this article are outdated, so I have included another below.)

  1. In the <head>, add the following code containing HubL tokens ("personalization tokens"):
<script type="application/json+trustpilot">
    "recipientName": "{{ contact.firstname }} {{ contact.lastname }}",
    "recipientEmail": "{{ }}",
    "referenceId": "{{ contact.your_custom_property's_internal_name }}",
    "productSkus": ["{{ contact.your_custom_property's_internal_name }}","{{ contact.your_custom_property's_internal_name }}"]
  1. The HubL tokens will populate each recipient's corresponding property values in the final email. My test produced the following:



Sorry for the later reply @Isaac_Takushi. Thank you so much for taking the time to answer my question!!!