Programable Emails : access hubspot_owner_id var

Hello Guys,

I’m trying to create a module with the programable email feature enabled, and I can’t access some variables with HubL, like {{ contact.hubspot_owner_id }}, or {{ contact.company }} or getting in which lists the user is part of.

Am I missing something ? hubspot_owner_id.email is working when used as a personalization token.

I need to make conditionnal render based on the owners email like {% if contact.hubspot_owner_id.email == “qhorin@…” %}

@Qhorin - I have to say that I’m curious on this one as well! It would seem obvious to be able to use the same HubL format as personalization tokens, but perhaps the context is not quite the same.

The programmable email documentation suggests to retrieve those contact properties that you should use the

crm_object

form of HubL to access standard object values - but then on the associated HubL documentation it suggests their are security limitations on use of this function on a public page (not clear if an email crosses that threshold?)

Hope this can be cleared up!

Steve

Hey, thx for the reply

When I try to retrieve it this way,

{% set c = crm_object("contact", contact.id, "hubspot_owner_id", false) %}

I get this error :

CONTACT objects can only be retrieved on membership or password-restricted pages

Also,

contact.associatedcompanyid is also empty, but not always, for the same contact :thinking:

and contact.list_memberships seems to always be empty aswell

contact.hubspot_owner_id dont exists at all when I pprint the contact variable

Interestingly, this used to work. I opened up a few older email templates this morning to discover that I had written code to accomplish the exact type of conditionals you’re describing, but none of it works any longer. At some point the team retired or broke this feature.