La fonction de suggestion automatique permet d'affiner rapidement votre recherche en suggérant des correspondances possibles au fur et à mesure de la frappe.
Personalization tokens with associated objects in emails
Résolue
How can I show information from a custom object's associated record within an email? I believe I need to use personalization tokens, but the only values I can see are the properties of the custom object, not for the associated custom object.
For example, I can get the expiration date of a "reservation" with the following and have it render in an email. Expriation date is a property on this custom object. So I can see it.
Personalization tokens with associated objects in emails
Résolue
EDIT: Note that it seemed to be possible with my previous answer, but that's not true. You have to hard code the object ID for it to work. It seems you can't pass the ID as fetched from "personalization_token" to "crm_assocations".
ORIGINAL MESSAGE BELOW:
It turns out this is possible thanks to "crm_assocations". It goes a bit like this:
{% set facility_hours = crm_associations(57297248, 'USER_DEFINED', 46) %}
<p>
{{ facility_hours }}
</p>
<p>
{% for item in facility_hours.results %}
<p>
{{ item.day_of_week }}
</p>
{% endfor %}
</p>
The first parameter is the current reservation ID (reservations being a custom object schema we created). The third parameter is an ID telling HubSpot which type of object to look for (in this case, the hours of operation). The second parameter, which doesn't seem to be currently documented, says that this is a user-defined custom object.
I'm not sure there's a straightforward way to find the third parameter (can be done with React tools by inspecting the data in the HubSpot UI for the custom object detail page), but the first parameter can be figured out with the "personalization_token" function.
Personalization tokens with associated objects in emails
Résolue
EDIT: Note that it seemed to be possible with my previous answer, but that's not true. You have to hard code the object ID for it to work. It seems you can't pass the ID as fetched from "personalization_token" to "crm_assocations".
ORIGINAL MESSAGE BELOW:
It turns out this is possible thanks to "crm_assocations". It goes a bit like this:
{% set facility_hours = crm_associations(57297248, 'USER_DEFINED', 46) %}
<p>
{{ facility_hours }}
</p>
<p>
{% for item in facility_hours.results %}
<p>
{{ item.day_of_week }}
</p>
{% endfor %}
</p>
The first parameter is the current reservation ID (reservations being a custom object schema we created). The third parameter is an ID telling HubSpot which type of object to look for (in this case, the hours of operation). The second parameter, which doesn't seem to be currently documented, says that this is a user-defined custom object.
I'm not sure there's a straightforward way to find the third parameter (can be done with React tools by inspecting the data in the HubSpot UI for the custom object detail page), but the first parameter can be figured out with the "personalization_token" function.
Personalization tokens with associated objects in emails
Résolue
You would be able to retrive the object without hard coding the value if you make use of the Programmable Email Beta . This will allow you to pass some other property instead. For example
{% set facility_id = p12345_facility.hs_object_id %}
{% set facility_hours = crm_associations(facility_id, 'USER_DEFINED', 46) %}