I have the following RPL code in an email:
<#data ALERTS as alerts>
<#filter USER_ID1=CONTACTS_LIST.CUSTOMER_ID_1>
<#fields AD_ID_LIST1>
<#assign cellCount = 0>
<#list alerts.AD_ID_LIST1?split(r'\s*,\s*', 'r') as idString>
<#data AD_TABLE as adtable>
<#filter AD_ID="${idString}">
<#fields AD_ID TITLE IMAGES DESCRIPTION PRICE_AMOUNT PRICE_TYPE CATEGORY_ID1 AD_STATE>
<#if idstring?? && adtable.AD_STATE='ACTIVE'>
<#assign cellCount = cellCount + 1>
<#if cellCount % 2 == 1 && idString_has_next == false>
<!-- INCLUDE SINGLE -->
<#elseif cellCount % 2 == 1 && idString_has_next == true>
<!-- Include LEFT -->
<#else>
<!-- INCLUDE RIGHT -->
</#if>
</#if></#data></#list></#data>
What I need to do is have the email skip sending to the user if cellCount = 0 after the determining that there are no Ad ids to show (whether there status is not active or they have been deleted from the table.
Does anyone know how to do this ?
you can use the skip directive eg: