I’m new to hubspot, and I wanted to know if I can pull data from HubDB if the email address there is the same as the email contact email recipient? I’m creating a custom module that I can drag-and-drop into an email.
I’m not using the programmable email beta, but wanted to know if it’s possible without it?
I was able to pull data when i tried hardcoding the email address, but when i used ‘contact.email’ to make it more dynamic, it says didnt find the email address nor displays the data, despite the contact email address being in the hubdb table.
example code:
{% email = contact.email %}
{% set contact_email = contact.email %}
{% set query = ‘emailaddress=’ ~ contact_email %}
{% set rows = hubdb_table_rows(1234678, query) %}
Hey, @loumd2 Thank you very much for including your code example in your post. That is always helpful to our community members when they are troubleshooting.
My understanding is that this won’t work as expected without something like the Programmable Email Beta. Your approach should work if you were using a webpage instead of an email.
Some other options could include:
using Active Lists and Smart Content to display different content for each section
some form of pre-processing, creating a custom property, and populating the custom property on specific records so that you can use the standard personalization tokens available in emails
opting into the Programmable Email Beta if your portal has a matching subscription, as this would allow you to accomplish your goal in a more direct manner (I understand if this is not an option)