The function ecx:isEmptyCouponList determines whether coupon codes remain in the specified coupon list. The value returned is a Boolean data type.

Examples

A message displays coupon codes from a coupon list. A personalization is displayed in the message when there is a coupon available and also when there are no coupons remaining.

The placeholder that marks where the personalisation is inserted when coupons are available in the coupon list is constructed as follows:

<%InsertIf expression="${(ecx:isEmptyCouponList(coupon['MyCouponList'])=='false'))}"%>Instructions for redeeming the coupon.<%InsertIf%>
CODE

As long as there are coupons in the list, this function returns the value ​false​. Comparing this result with the equals operator ​==​ to the static value '​false​' returns the Boolean ​true​, which satisfies the condition for inserting the personalization.

The placeholder that marks where the personalisation is inserted when no coupons are available in the coupon list is formatted as follows:

<%InsertIf expression="${ecx:isEmptyCouponList(coupon['MyCouponList'])}"%>No coupons left.<%InsertIf%>
CODE

When there are no remaining coupons in the target list, this function returns the Boolean ​true​, which satisfies the condition for inserting the personalization.

Structure​

ecx:isEmptyCouponList(object)

Parameters​

Parameter

Description

object

The name of the coupon list.