Skip to main content

Gift widget

The Gift Widget allows users to give each other gifts in the form of badges and/or points. Using this widget, one user can give another any of the Gifts or Giftable Points configured in the Administration Panel.

Gift widget interface for sending rewards to other users The Gift Widget interface allowing users to select recipients, gift types, and add personalized messages

Implementation

To render the Gift Widget, add a call to the Mambo gift() function in the mamboCallbacks() array. The example below shows the function call with all available options. None of these options are required, so you could simply use: Mambo('.selector').gift().

JavaScript

Configuration options

Each option found in the code above is explained in detail below. None of these options are required.

Display options

OptionDescriptionDefault ValueSample Value
popupWhen enabled, displays the widget in a popup in the middle of the screen. When using this option, a class selector is not required.falsetrue
titleAllows you to override the default title displayed in the widget.nullSend a Gift
prizeAdds a prize message under the widget title. This can be used to describe an activity triggered by the triggerActivity option, providing users with additional incentive to give gifts.nullWin 600 points

Gift content options

OptionDescriptionDefault ValueSample Value
withPointsEnables or disables the option to give points through the widget.truefalse
withGiftsEnables or disables the option to give Gift rewards through the widget.truefalse
requireReasonDetermines whether the reason field ("Tell them why") is mandatory when sending a gift.truefalse

User filtering options

OptionDescriptionDefault ValueSample Value
tagsSpecifies tags that users must have in order to appear in the search results. This allows you to focus gifting on particular subsets of users, such as members of a specific department or office location.null['finance_dept','hr_dept']
tagsJoinDetermines whether users must have all specified tags (hasAllOf) or any of the specified tags (hasAnyOf) to appear in search results.hasAnyOfhasAllOf

Activity triggers

OptionDescriptionDefault ValueSample Value
triggerActivityDefines an activity that will be triggered for the user who performs the gifting. This allows you to reward the sender with any type of activity (behaviour, point, coupon, etc). See Create activities for sample data objects.nullSee activities documentation