Handlebars Helper Function: assignCoupon

Claims a coupon row from a marketing object for the current recipient. Use this helper to assign a coupon code from a coupon list.

This helper is available in the Winter ’27 release of Marketing Cloud Next.

ParameterTypeDescription
listStringRequired. The name of the marketing object that contains the coupon rows.

The function returns the claimed coupon row as an object. Use the get helper to retrieve values from the returned row.

For a coupon list that isn’t configured to always assign a new coupon, the helper returns the coupon previously assigned to the same recipient.

If no coupon is available, the coupon list isn’t valid, or the recipient doesn’t have an individual ID, the function throws an exception. You can use the fallback helper to handle an unavailable coupon.

This example assigns a coupon and renders the value in the CouponCode field.

This example renders a fallback message when a coupon isn’t available.