Show/Hide Modules Based on User Deals

Hello,

I am looking to show/hide a module in my HubSpot email based on the User’s Program interest which lives in Deal in our case. When I do for example,

{% if deal.partner_program_name == “AI Prompting” %}

Module

{% endif %}

This doesn’t do anything at all. Anyone have an idea as to how to achieve this?

Hi @FathimaReeza,

Just to confirm, how exactly are you testing this? Generally, deal personalization only works when emails are sent from deal-based workflows. Showing and hiding modules would, if it works at all, also be subject to the same requirement. It wouldn’t work for regular email sends, for example.

If you can’t get this to work, then – as far as I know – you could make the information you want to show/hide modules by on the contact record. One option to do so would be via a sync property: Create sync properties that copy data to associated records

Best regards!

But I read that if we were to sync properties it wouldn’t align the deal property value with the correct contact. Is that true? SO I am confused as to what’s the purpose of this sync property if it doesn’t align the value with the correct contact.
For example, we want to do SMS. But we can’t have both SMS and Email in the same workflow because of this contact/deal issue. So we have to create it’s own workflow for SMS so we can bring in the deal property in. But if this sync property is a solution doesn’t it make sense for it align the value with the correct contact as well?

Hi @FathimaReeza
Your code isn’t working because HubSpot emails don’t have direct access to deals only contact properties unless the email is sent via a deal based workflow. For regular marketing emails, the best workaround is to copy the deal property into a contact property (via sync or workflow) and then use that property for your conditional logic or smart modules.

Got it, thank you for this explnation.