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
| Class | Description | Required |
|---|---|---|
| mambo-ctrl-coupon | Wrapper for each coupon element. Used to insert timers and control coupon display | Yes |
| mambo-ctrl-timer | Element where countdown timers should be injected | No |
Template data
| Variable | Description | Type |
|---|---|---|
| data | Array of coupons to render. For complete details on the coupon data model, refer to the User's Coupons API | Array |
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