Skip to main content
When a reward uses the Created in Mention Me Shopify fulfilment option (Mention Me creates the discount in your store), you can personalise the generated codes using template tokens. This makes codes more memorable and brand-aligned - for example, THANKS-SAM20 instead of a random string.
Personalised templates only apply to the Created in Mention Me option. If a reward is Managed in Shopify (you pre-create the discount and link it), you set codes in Shopify instead. See the Shopify fulfilment guide for the difference between the two options.
This page covers discount code templates for the Referral product. For influencer discount code templates, see Setting Up Automatic Shopify Discount Code Generation.

Available tokens

Combine these tokens with free text to build your template: All tokens resolve to uppercase, and spaces and special characters (other than hyphens and underscores) are removed automatically.

Example templates

How token values are resolved

The tokens always resolve to the referring customer’s name - that is, the person who made the referral, not the friend who was referred.
  • For a referee reward (the friend’s discount code), the system walks back to the referrer who introduced them.
  • For a referrer reward (the advocate’s own reward), the system uses their own name.
Name values come from the customer’s parsed first name and surname as stored in Mention Me. If a name is blank, the token renders as empty.
There are no {REFEREE_*} tokens. The standard Shopify referral flow only captures the friend’s email address, so referee name tokens cannot resolve reliably. They may be introduced in a future update.

Collision handling

If a generated code already exists in Shopify, Mention Me automatically appends a random 6-letter suffix to make it unique. For example, if SAM20 is taken, the code might become SAM20QRTVWZ. If a name token is blank (the customer has no name on file), the suffix alone forms the code, ensuring every discount code is non-empty.

Template length

Templates can be up to 128 characters long. The token placeholders (e.g. {REFERRER_FIRST_NAME}) count towards this limit, but the actual rendered code will typically be shorter since names replace the longer placeholder text.

Non-numeric amounts

The {AMOUNT} token only renders for numeric reward values (e.g. 10, 20). For description-based rewards (e.g. “a free handbag”), {AMOUNT} renders as empty. Decimal amounts have their separator stripped, so 5.99 renders as 599. Plan your template accordingly if you use non-monetary or fractional rewards.
Last modified on July 21, 2026