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

**URL:** <https://community.hubspot.com/t/can-you-reference-custom-properties-in-hubspot-emails-source-code/12588>\
**Category:** APIs & Integrations\
**Tags:** email\
**Created:** [December 28, 2018, 7:20pm UTC](https://community.hubspot.com/t/can-you-reference-custom-properties-in-hubspot-emails-source-code/12588 "2018-12-28T19:20:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [December 28, 2018, 7:20pm UTC](https://community.hubspot.com/t/can-you-reference-custom-properties-in-hubspot-emails-source-code/12588/1 "2018-12-28T19:20:08Z")

</div>

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”: “[customer@email.com](mailto:customer@email.com)”,  
“referenceId”: “1234abcd”,  
“productSkus”: [“ABC-1234”,“ABC-4321”]

}  
\</script\>

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

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [December 31, 2018, 4:04pm UTC](https://community.hubspot.com/t/can-you-reference-custom-properties-in-hubspot-emails-source-code/12588/2 "2018-12-31T16:04:14Z")

</div>

Welcome, [@a.ayodeji](https://community.hubspot.com/u/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](https://knowledge.hubspot.com/articles/kcs_article/cos-general/how-do-i-get-an-html-version-of-my-hubspot-template) are outdated, so I have included another below.)

![]()

Clone to HTML.jpg401×547 41.5 KB

1. In the `<head>`, add the following code containing HubL tokens (["personalization tokens"](https://knowledge.hubspot.com/articles/kcs_article/cos-general/how-to-use-personalization-with-your-content)😞

```auto
<script type="application/json+trustpilot">
 {
 "recipientName": "{{ contact.firstname }} {{ contact.lastname }}",
 "recipientEmail": "{{ contact.email }}",
 "referenceId": "{{ contact.your_custom_property's_internal_name }}",
 "productSkus": ["{{ contact.your_custom_property's_internal_name }}","{{ contact.your_custom_property's_internal_name }}"]
 }
</script>

```

1. The HubL tokens will populate each recipient’s corresponding property values in the final email. My test produced the following:

![]()

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [January 15, 2019, 10:59pm UTC](https://community.hubspot.com/t/can-you-reference-custom-properties-in-hubspot-emails-source-code/12588/3 "2019-01-15T22:59:09Z")

</div>

Sorry for the later reply [@Isaac\_Takushi](https://community.hubspot.com/u/isaac_takushi). Thank you so much for taking the time to answer my question!!!
