APIs & Integrations

McKenzieMurphy
Member

Transactional Email Using Name in Contact Record Not JSON Object

SOLVE

When we send an email via the Hubspot API, the contact tokens with the email template are pulling from the Hubspot profile rather than the JSON object we are sending. For example, if a Hubspot contact has a first name of 'John' and we send an API call with the first name of 'Sarah,' 'John' will be used in the email. Then, 'Sarah' will be used to update the record in Hubspot.

Is this process occurring as expected?

0 Upvotes
1 Accepted solution
Derek_Gervais
Solution
HubSpot Alumni
HubSpot Alumni

Transactional Email Using Name in Contact Record Not JSON Object

SOLVE

Hi @McKenzieMurphy,

I take it you're using the Single Send API? It depends on what token you're using to include the value in your email. Contact properties (pulled from the HubSpot contact record) look like this:

{{ contact.property_name }}

While custom properties (pulled from the custom proeprty JSON sent with the Single Send API request) look like this:

{{ custom.property_name }}

Are you sure you're using a custom property token instead of a contact property token?

View solution in original post

0 Upvotes
2 Replies 2
Derek_Gervais
Solution
HubSpot Alumni
HubSpot Alumni

Transactional Email Using Name in Contact Record Not JSON Object

SOLVE

Hi @McKenzieMurphy,

I take it you're using the Single Send API? It depends on what token you're using to include the value in your email. Contact properties (pulled from the HubSpot contact record) look like this:

{{ contact.property_name }}

While custom properties (pulled from the custom proeprty JSON sent with the Single Send API request) look like this:

{{ custom.property_name }}

Are you sure you're using a custom property token instead of a contact property token?

0 Upvotes
McKenzieMurphy
Member

Transactional Email Using Name in Contact Record Not JSON Object

SOLVE

Hey Derek,

We were initially using the contact property, but changed to the custom and now it is working correctly.

Thanks,

McKenzie