Goal​

To display different parts of the message, based on coupon availability.

Prerequisites​

The Coupon Manager is a billable feature that must be activated for your system. To activate the coupon manager, contact your customer service representative.

There is alternative text stored in the coupon list which is sent if no coupons are available (see Create a New Coupon List​).

Background Information​

In most cases, it is not desirable to interrupt message sendout due to missing coupons. When the Display Alternative Text option is activated for the coupon list, predefined alternative text replaces the coupon code in the message when there are no coupons left in the list (see Create a New Coupon List​).

The rest of the email remains unchanged.

If an entire section of the email needs to be replaced in the email when no more coupons are available, alternative sections must be inserted into the email.

These sections are marked with a personalisation (InsertIf). The personalisation makes it possible to produce different versions of an e-mails to customers, depending on whether or not they receive a coupon.

Procedure​

  1. Create a personalisation to mark the part of the email that is inserted when coupons are available in the coupon list:
    <%InsertIf expression="${(ecx:isEmptyCouponList(coupon ['MyCouponList'])=='false'))}"%>
    This function verifies that the coupon list is not empty.
    Replace MyCouponList with the name of your coupon list.
  2. Create a personalisation to mark the part of the email that is inserted when no coupons are available in the coupon list:
    <%InsertIf expression="${(ecx:isEmptyCouponList(coupon ['MyCouponList'])== 'true'))}"%>
    This function verifies that the coupon list is empty.
    Replace MyCouponList with the name of your coupon list.
  3. When necessary, the personalisation can of course be refined with additional conditions.
    Example:
    The text part without coupon, should always be sent when no coupons are available or if the recipient has yet to generate a conversion. The presence of conversions is stored in the ​Customer​ Boolean attribute. ​True​ means that they have already produced conversions.
    <%InsertIf expression="${(ecx:isEmptyCouponList(coupon ['MyCouponList])== 'true') or (user.CustomAttribute['Customer']== ' true ' ))}"%>
  4. Save the personalisation in the ​Personalisation Builder​ (see ​Save an Existing Personalisation for Later Use​). The personalisation of existing coupons cannot currently be edited in the graphical mode. It is possible to reuse and edit personalisations in the code view.

  5. Access the email and personalise the text parts that are sent when coupons are available or not available (see ​Insert a personalisation​).

Actual coupons from the coupon list are never used for test and preview messages. If no preview text is entered, default text is generated from the name of the list. For example, the default text for a coupon list named birthday coupons is birthdaycoupons_preview Coupon.