Dear HubSpot team,
I am having trouble sending test email when wrapping a module in a conditional statement:
{% if contact.product_for_email_1__c != 'None' %}
{% module "module_165944613959018" path="/XXXX/Product card", label="Product card" value={{ contact.product_for_email_1__c }} %}
{% endif %}
On the email live preview, the logic is working fine but when I try to send an test email, I got the following error:
{errorMessage: "Content public api error: portalId: 26081264, path: internal/simple-render/for-html, response: CachingHttpResponse{statusCode=400, body=<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\"/>\n<title>Error 400 Bad Request</title>\n</head>\n<body><h2>HTTP ERROR 400</h2>\n<p>Reason:\n<pre> Bad Request</pre></p>\n</body>\n</html>\n}" eventId: null ready: true sendResult: null sendStatus: "TEMPLATE_RENDERING_FAILED"}
The content of the custom module is only “Hi”.
If I change the code to
{% if contact.product_for_email_1__c != 'None' %}
Hi
{% endif %}
The emails preview is fine and I can send test email.
Also, if I try to embedded the logic into the module, the module is always printing Hi, even though module.value = ‘None’. I can send test email though.
{% if module.value != 'None' %}
Hi
{% endif %}
Maybe it’s linked to the fact that contact.product_for_email_1__c is a custom property synced from Salesforce?
![]()
Could you please advise.
