<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: HubL if statement  for custom contact properties in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/HubL-if-statement-for-custom-contact-properties/m-p/439125#M23190</link>
    <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/118421"&gt;@kate4&lt;/a&gt; yeahh &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; I came across this regarding emails on this page&amp;nbsp;&lt;A href="https://developers.hubspot.com/docs/cms/hubl/if-statements" target="_blank"&gt;https://developers.hubspot.com/docs/cms/hubl/if-statements&lt;/A&gt;\&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Please note that u&lt;/SPAN&gt;&lt;SPAN&gt;sing personalization variables (contact and company variables) within if statements is&amp;nbsp;not currently supported for email in HubSpot. These variables can be used for logic&amp;nbsp;on HubSpot CMS pages and blog templates.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Additionally, information passed via the Transactional Email API will not function within if statements, as the templates compile before the information populates.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 19 May 2021 16:44:22 GMT</pubDate>
    <dc:creator>jonchim</dc:creator>
    <dc:date>2021-05-19T16:44:22Z</dc:date>
    <item>
      <title>HubL if statement  for custom contact properties</title>
      <link>https://community.hubspot.com/t5/CMS-Development/HubL-if-statement-for-custom-contact-properties/m-p/438714#M23160</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I am creating a template for abandoned carts email. How do I output some html with custom contact properties only if those properties are not empty or zero?&lt;BR /&gt;My code:&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{% if contact.abandoned_item_product_name_1 %}
    &amp;lt;table class="templateColumnWrapper" cellpadding="10"&amp;gt;
    &amp;lt;tbody&amp;gt;
    &amp;lt;tr&amp;gt;
    &amp;lt;td class="column" style="vertical-align: middle;"&amp;gt;
    &amp;lt;img src="{{ contact.abandoned_item_product_img_1 }}" width="130" style="max-width: 130px;"&amp;gt;
    &amp;lt;/td&amp;gt;
    &amp;lt;td class="column summary" style="vertical-align: top;"&amp;gt;
    &amp;lt;div&amp;gt;&amp;lt;b&amp;gt;{{ contact.abandoned_item_product_name_1 }}&amp;lt;/b&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;div&amp;gt;{{ contact.abandoned_item_product_price_1 }} {{contact.abandoned_base_currency}}&amp;lt;/div&amp;gt;
    &amp;lt;/td&amp;gt;
    &amp;lt;/tr&amp;gt;
    &amp;lt;/tbody&amp;gt;
    &amp;lt;/table&amp;gt;
{% endif %}&lt;/LI-CODE&gt;&lt;P&gt;This is the result:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kate4_0-1621355506910.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/42849i356E83C464D15F63/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kate4_0-1621355506910.png" alt="kate4_0-1621355506910.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 May 2021 16:36:03 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/HubL-if-statement-for-custom-contact-properties/m-p/438714#M23160</guid>
      <dc:creator>kate4</dc:creator>
      <dc:date>2021-05-18T16:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: HubL if statement  for custom contact properties</title>
      <link>https://community.hubspot.com/t5/CMS-Development/HubL-if-statement-for-custom-contact-properties/m-p/438982#M23177</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/118421"&gt;@kate4&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not entirely sure but try adding an if statment to wrap the product price and base currency, something like the below. I think this may work if the property is blank, not sure if it will work if it's filled in with a 0.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;&amp;lt;div&amp;gt;
  {% if contact.abandoned_item_product_price_1 %}
    {{ contact.abandoned_item_product_price_1 }} {{contact.abandoned_base_currency}}
  {% endif %}
&amp;lt;/div&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 May 2021 12:27:32 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/HubL-if-statement-for-custom-contact-properties/m-p/438982#M23177</guid>
      <dc:creator>jonchim</dc:creator>
      <dc:date>2021-05-19T12:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: HubL if statement  for custom contact properties</title>
      <link>https://community.hubspot.com/t5/CMS-Development/HubL-if-statement-for-custom-contact-properties/m-p/439118#M23189</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/55480"&gt;@jonchim&lt;/a&gt;&amp;nbsp;!&lt;BR /&gt;It doesn't work for me(.&amp;nbsp; I found articles that the if statement was not supported for Contact Properties. For example, &lt;A href="https://community.hubspot.com/t5/CMS-Development/Contact-Property-If-Statement-in-Email/td-p/1895" target="_blank"&gt;https://community.hubspot.com/t5/CMS-Development/Contact-Property-If-Statement-in-Email/td-p/1895 &lt;/A&gt;. Or this one&amp;nbsp;&lt;A href="https://community.hubspot.com/t5/HubSpot-Ideas/if-statements-in-email-templates/idi-p/282907#comments" target="_blank"&gt;https://community.hubspot.com/t5/HubSpot-Ideas/if-statements-in-email-templates/idi-p/282907&lt;/A&gt;.&amp;nbsp;&lt;BR /&gt;"if" statements don't work right now?&lt;/P&gt;</description>
      <pubDate>Wed, 19 May 2021 16:23:40 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/HubL-if-statement-for-custom-contact-properties/m-p/439118#M23189</guid>
      <dc:creator>kate4</dc:creator>
      <dc:date>2021-05-19T16:23:40Z</dc:date>
    </item>
    <item>
      <title>Re: HubL if statement  for custom contact properties</title>
      <link>https://community.hubspot.com/t5/CMS-Development/HubL-if-statement-for-custom-contact-properties/m-p/439125#M23190</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/118421"&gt;@kate4&lt;/a&gt; yeahh &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; I came across this regarding emails on this page&amp;nbsp;&lt;A href="https://developers.hubspot.com/docs/cms/hubl/if-statements" target="_blank"&gt;https://developers.hubspot.com/docs/cms/hubl/if-statements&lt;/A&gt;\&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Please note that u&lt;/SPAN&gt;&lt;SPAN&gt;sing personalization variables (contact and company variables) within if statements is&amp;nbsp;not currently supported for email in HubSpot. These variables can be used for logic&amp;nbsp;on HubSpot CMS pages and blog templates.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Additionally, information passed via the Transactional Email API will not function within if statements, as the templates compile before the information populates.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 May 2021 16:44:22 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/HubL-if-statement-for-custom-contact-properties/m-p/439125#M23190</guid>
      <dc:creator>jonchim</dc:creator>
      <dc:date>2021-05-19T16:44:22Z</dc:date>
    </item>
  </channel>
</rss>

