Use the built-in Vouchers feature rather than juggling tags yourself. Voucher pools hand out a unique code per user, guarantee no duplicates, and record which code each user received.
Recommended approach (voucher pools)
- Create a voucher pool and upload your codes. One pool per promotion, so different events can draw from different pools. See Vouchers.
-
Put the
{{voucher}}placeholder in your email template (subject or body). This is the placeholder the voucher engine substitutes. - Build the event-triggered Customer Journey. Use a trigger-based entry on the event that should award the code, then add the Email element with your template.
- Enable vouchers on that element. In the element's personalization settings switch on Use Vouchers and select the pool. Optionally assign a tag so the code delivered to each user is stored for later reference or support lookups.
Because each Journey (or each Email element) points at its own pool, a user who qualifies for several promotions at different times gets the right code each time — no manual mapping needed.
If you must supply the code yourself
If the code is generated in your own system, set it on the user with the Device API /setTags method before triggering the email, then reference the tag in the template with Liquid using the tag name directly:
{{ milestone_A_voucher }}
Note the syntax: Pushwoosh placeholders are {{ TagName }} — there is no tags. prefix. Tag names must contain only letters, digits, and underscores (no spaces). See Liquid templates.
Alternatively, if the code arrives with the event itself, pass it as an event attribute and reference that attribute in the message instead of storing a tag.
Comments
0 comments
Please sign in to leave a comment.