Skip to main content

Coupon template

Description

The coupon template renders individual coupons throughout the widgets, including in the coupons and notification templates. It takes an array of coupons as input and renders each one.

Control classes

ClassDescriptionRequired
mambo-ctrl-couponWrapper for each coupon element. Used to insert timers and control coupon displayYes
mambo-ctrl-timerElement where countdown timers should be injectedNo

Template data

VariableDescriptionType
dataArray of coupons to render. For complete details on the coupon data model, refer to the User's Coupons APIArray

Implementation example

This example shows a basic coupon template that displays coupon codes:

JavaScript

Customisation options

Consider these enhancements:

  • Adding visual styling based on coupon status (available, used, expired)
  • Implementing countdown timers for expiring coupons
  • Adding copy-to-clipboard functionality for coupon codes
  • Creating QR code generation for in-store redemption
  • Adding barcode display for point-of-sale scanning