Hi @vpetr
Yes, HubSpot’s programmable emails fully support using contact properties with HubL (HubSpot Markup Language). If everything is set up correctly, your test should work just fine.
If it didn’t work as expected, here are a few things you should check:
- Enable Programmable Email Beta:
HubL logic (like using contact.email or contact.interest) only works in emails if the “Programmable Email Beta” feature is turned on.
- For Modules: When editing your module, make sure the “Email templates” option is checked and the toggle for “Enable module for programmable email beta” is turned on in the right sidebar.
- For Custom Templates: Add this line at the very top of your template file:
isEnabledForEmailV3Rendering: true
- Use the Correct Internal Property Name:
HubL uses internal property names — not the display labels you see in the UI.
- For default properties like email, use contact.email.
- For custom properties, go to Settings > Properties, find the property, and use the internal name shown there (e.g., contact.interest, not necessarily just “Interest”).
- Test Properly:
Make sure you’re testing with real contact data.
- In the email preview, choose “Preview as a specific contact” and pick one that actually has the relevant property values (like “italy” for interest).
- If the selected contact doesn’t have a matching value, HubSpot will show the else condition.
- Best test? Actually send the email to a few test contacts with different values to confirm it’s working.
- Check for Caching or Publishing Issues:
If you made changes to your module or template, publish them again. HubSpot sometimes uses cached versions unless manually updated.
- Check Where You Placed the HubL Code
Make sure the HubL logic isn’t being blocked or overridden by other parts of your HTML. Keep it clean and well-placed in your email body.
Example Template
Here’s how a working version of your email might look:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Your Personalized Email</title>
</head>
<body>
<h1>Hello {{ contact.firstname|default("there") }}!</h1>
{% if contact.interest == "italy" %}
<p>Explore Italy: Discover amazing tours of Rome, Florence, and Venice!</p>
<img src="https://example.com/italy_promo.jpg" alt="Italy Travel">
{% else %}
<p>Explore the world: Check out all our travel destinations.</p>
<img src="https://example.com/general_travel.jpg" alt="General Travel">
{% endif %}
<p>This email was sent to {{ contact.email }}.</p>
{{ unsubscribe_link }}
{{ site_settings.company_name }}
{{ site_settings.company_street_address_1 }}, {{ site_settings.company_city }} {{ site_settings.company_state }} {{ site_settings.company_zip }}
</body>
</html>
In short: Make sure the programmable email feature is enabled, use the correct internal property names, preview/test it with real contact data, and publish updates. Once all that’s done, your personalization logic should work smoothly!
I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
Thanks!