CMS Development

dmsacco1011
参加者

If Conditional Logic

I am trying to write if/else logic in an email:

-If a custom property is null show nothing

-Everything else show XX

 

I tried testing it with both of the following formats and a few others and I'm not sure what I'm missing:

 

{% if custom.orderPromoCodeDeduction='null' %} 

Null

{% else %}
Other
{% endif %}

 

{% if custom.orderPromoCodeDeduction == 'null' %} 

Null

{% else %}
Other
{% endif %}

 

Is there a format I should be using?

0 いいね!
2件の返信
dennisedson
HubSpot製品開発チーム
HubSpot製品開発チーム

If Conditional Logic

@dmsacco1011

{% if custom.orderPromoCodeDeduction %} 

//content for if it exists

{% else %}

//content if it doesnt

{% endif %}

remove the null

 

here is a reference

 

dmsacco1011
参加者

If Conditional Logic

I was attempting this in the single send transactional emails. Which does not support conditional logic. 

0 いいね!