How to use statements based on custom values in the email body using the transactional email single send API


We are using the single send API for our transactional emails and within the body we have the need to frequently check if a value is present or equal to x render this block else return null and so forth. Imagine a complicated email filled with tons of conditional data. It seems that we can not create conditions in the email body based on these custom properties. Do we really have to rely on our back-end to pass blocks of html based on our needs or is there some solution within the body?


Hi @AdrienneD,

You're correct that information passed via the Transactional Email API will not function within HubLif statements, as the templates compile before the information populates. For now, your best bet would be to pass the correct HTML from your system. I can understand the use case you're describing, though; if you have the inclination, I would encourage you to check out the Ideas Forum on the HubSpot Community. There, you can create a post including your use case that product and other customers can see.