---
title: "Adapt Message Content Based on Coupon Availability"
slug: "show-message-parts-using-available-coupons"
updated: 2025-04-29T15:10:18Z
published: 2025-04-29T15:10:18Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mapp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Adapt Message Content Based on Coupon Availability

## Goal

Adapt the displayed content within a message based on whether coupons are still available in a selected coupon list.

---

## Background Information

In Mapp Engage, you can dynamically adapt message content depending on the availability of coupons. This ensures that recipients see the right content even if a coupon list runs out of codes during sendout. The logic is implemented using *InsertIf* expressions that control which content block is shown in the final message.

---

## Prerequisites

- A coupon list must exist with the **Display Alternative Text** setting activated (see *Create a New Coupon List*).
- Basic understanding of personalization syntax (*InsertIf* expressions).

---

## Procedure

1. In the *Main Navigation*, go to *Audience > Segmentation > Personalization*.
2. Click **Create** to open the *Personalization Builder*.
3. In the *Personalization Builder*, create a personalization for when coupons are available:

```xml
<%InsertIf expression="${(ecx:isEmptyCouponList(coupon['MyCouponList']) == 'false')}"%>
```
  - Replace **MyCouponList** with the name of your coupon list.
  - This expression displays the corresponding content when coupons are available.
4. Create a personalization for when no coupons are available:

```xml
<%InsertIf expression="${(ecx:isEmptyCouponList(coupon['MyCouponList']) == 'true')}"%>
```
  - This expression displays different content when the coupon list is empty.
5. (Optional) Refine the personalization with additional conditions.

Example: Show alternative content if no coupons are available **or** if the customer has not yet completed a purchase:

```xml
<%InsertIf expression="${(ecx:isEmptyCouponList(coupon['MyCouponList']) == 'true') or (user.CustomAttribute['Customer'] == 'true')}"%>
```
6. Save the personalization.
7. Insert the personalization into the message content where you want the dynamic blocks to appear (see [Insert a Personalization](/v1/docs/insert-a-personalization)).

---

## Additional Information

> [!TIP]
> ![](https://cdn.document360.io/554b9b98-6720-4d8b-9919-c7b203d72648/Images/Documentation/grafik(33).png)
> 
> Looking for a structured learning path?
> 
> Learn step by step in our Academy Course: [Mapp Engage - Personalization Rules](https://academy.mapp.com/catalog/courses/2783025).

- Actual coupons are not inserted during test or preview messages. If no preview text is defined, the system automatically generates placeholder text based on the coupon list name (e.g., *birthdaycoupons_previewCoupon*).
- For general information about managing coupon lists, see [Manage Coupon List](/v1/docs/managing-coupon-lists).
