HUBL Email module issue

I’m experiencing an issue where the “request_contact” variable (referenced here as one that should be available to all hubl templates:

HubL variables - HubSpot docs) is available when previewing a custom email module, but empty when the actual email is sent. Am I doing something wrong?

To add a little more context, I need the vid in order to pull the user’s associated deals into the email body. Again, everything works great in the preview :disappointed_face:

Inside the preview:

^^ NOTE THAT THE CONTACT VID IS POPULATED IN ABOVE

When viewing in my inbox:

Does anyone have any insight into what’s going on? I keep rereading the documentation and I don’t see anything indicating that I shouldn’t have access to that object from the email module.

Thanks,

Elena

Hello @ehearty

Could you add your code here as well to look at?

@Kevin-C might be able to help!

Thanks @ehearty

Hey @ehearty

I am able to replicate this. But not sure if this is a bug or intended as I didn’t see anything in the documentation.

Test:

{{ request_contact }} {# returns null #}

{{ request_contact|pprint }} {# returns null #}

{{ request_contact ? true : false }} {# returns false #}

{% for obj in request_contact %} {# returns ' ' #}
 {{ obj|pprint }}<br><br>
{% endfor %}

@Kevin-C wrote:

I am able to replicate this. But not sure if this is a bug or intended as I didn’t see anything in the documentation.


Thanks @Kevin-C ! My hunch is that it’s a bug, given that “request_contact” is listed as one of the variables available to all templates here: HubL variables - HubSpot docs, and of course that it works in the preview. Otherwise I’d think it amounts to a bug in the documentation/preview. :thinking:

Thanks so much for getting back to me! Here’s the code that I’m using to print the contact vid in my custom email module:

REQUEST CONTACT VID is: {{request_contact.contactVid}}

At this point, I’ve commented out all other code, so I can say with complete certainty that:

a) The line prints the correct vid when shown for a selected contact in the preview, and

b) The line prints nothing when the email is actually sent (either through the test email option or via workflow)

Thanks so much for taking a look!

--Elena

@dennisedson & @Kevin-C,

Apologies, I’m still new to the platform, but is there some way I can follow up on this with the tech team? For example, is there somewhere I can submit a bug report?

Thanks,

Elena Hearty

Heyo @ehearty

You can always contact support, but in for this one specifically, I have been asking about. It looks like it is more a documentation issue rather than a bug. I spoken with documentation team and they have added a note to that specific variable in the docs.

Much appreciated, thank you @dennisedson!