Skip to main content

Notification template

Description

The notification template is used by the Notification Widget. Notifications can display various reward information, including coupons if the unlocked reward is associated with one. You can either render coupons directly within the notification or use control classes to have the Coupon Template render and inject the coupon.

Control classes

ClassDescriptionRequired
mambo-ctrl-closeCloses and removes the notification from the screen when clickedYes
mambo-ctrl-facebookDisplays a "Share to Facebook" popup with the reward information when clicked. Highly recommended for enabling social sharing of rewardsNo

Template data

The template receives the following data:

VariableDescriptionType
dataThe notification's reward data object containing all information about the reward to be displayed. For more details about the reward object, refer to the Notification WidgetObject
noteThe notification object containing all information about the notification displaying the dataObject
hasFBFlag indicating whether the Facebook SDK is available on the pageBoolean
hasTwitterFlag indicating whether the Twitter SDK is available on the pageBoolean
twitterUrlURL to be used when posting to Twitter. When adding a Tweet button, wrap it in an anchor tag (<a>) using this URL. If the Twitter SDK is available, a "Tweet" popup will appear with the notification's reward data ready to shareString

Implementation example

This example shows a simple notification template with Facebook sharing and close functionality:

JavaScript

Customisation options

Consider these enhancements for your notification template:

  • Adding reward images or icons
  • Implementing animations for notification entry/exit
  • Including Twitter sharing functionality
  • Customising appearance based on reward type
  • Adding countdown timers for time-limited rewards
  • Displaying coupon codes with copy functionality