Voucher helper functions
The voucher helper function lets you access any voucher pool created on CrossEngage and its attributes, so that you may send personalised discount codes to a user through any channel you have set up.
For more information on creating Voucher Pools, see our Voucher Documentation.
The #voucherPool helper function is used to access any voucher pools that you have set up in CrossEngage. Upon message dispatch, the function will access the selected pool and extract a voucher for each user.
Our system will remove any assigned vouchers from the selected pool to ensure that no duplicate vouchers can be sent.
The syntax of this helper function is:
1
{{#voucherPool '{"name": [Voucher pool name]}'}}
2
{{[Voucher pool attribute]}}
3
{{/voucherPool}}
Copied!
Property
Type
Description
name
string
Required. The name of the of the voucher pool that is accessed.
The voucher pool attributes that may be displayed within a message are the following:
Attribute
Description
name
Optional. The name of the of the voucher pool that is accessed.
code
Required. The voucher code extracted from the voucher pool.
validFrom
Optional. The date the voucher is valid from. e.g. 2018-07-14T00:00:00+0000To format this date, please use the date formatting function.
validTo
Optional. The date the voucher is valid to e.g.2018-08-25T00:00:00+0000. To format this date, please use the date formatting function.
value
Optional. The value or % amount of the voucher. e.g. 10.0.
type
Optional. The type of voucher. The types can be eitherpercentage or the same value as the value attribute, depending on how your voucher pool was set up.
currency
Optional. The currency of the voucher pool.
minBasket
Optional. The minimum basket value that a user must have to be eligible for using a voucher.
conditions
Optional. The usage conditions for this voucher.
created
Optional. The date the voucher pool was created.
modified
Optional. The date the voucher pool was last modified.

Alternative Method

Instead of writing a Handlebar expression from scratch, it is possible to obtain the relevant expressions from within the CrossEngage platform.
    Navigate to Moreand select Vouchers.
    Select the specific Voucher Pool you wish to embed in your marketing communication.
    On the right of the screen is displayed a list of voucher metadata. To pass any of these variables into your marketing communication using a Handlebar expression, simply click the icons indicated below. This will copy the desired Handlebar to your clipboard. Simply paste this formula into your campaign message.

Use cases

Displaying a discount
For this example, we access the Summer Sale voucher pool. This example voucher pool is valid from 01.07.2018 until 30.08.2018 and offers EUR 30.00 discounts to all shop visitors that make orders over EUR 200.00 in the category Summer Sale.
To display the voucher pool's validity dates in our preferred dd/mm/yyyy format, we will use the date formatting function.
1
{{#voucherPool '{"name": "Summer Sale Discount"}'}}
2
3
Use {{code}} to save {{value}} {{currency}} on your next order!
4
(valid {{computeDate '{"dateTrait": "validFrom", "outputFormat": "dd/MM/yyyy"}'}}
5
until {{computeDate '{"dateTrait": "validTo", "outputFormat": "dd/MM/yyyy"}'}})
6
*Only valid for purchases over {{minBasket}} {{currency}}.
7
Terms and conditions apply: {{conditions}}
8
9
{{/voucherPool}}
Copied!
Once the function is evaluated, it displays the following text in the section where it is used in the message:
1
Use SD30Sdjat77 to save 30.0 EUR on your next order!
2
(valid from 01/07/2018 until 30/08/2018)
3
*Only valid for purchases over 200.0 EUR.
4
5
Terms and conditions apply:
6
- This voucher is only valid for purchases made in our Summer Sale category.
7
- A voucher can only be used once.
8
- The voucher is non-transferable.
9
- This voucher must be redeemed on our website, applying it during the checkout process.
Copied!
Last modified 2yr ago