← All projects
FitGear: Anniversary Email & SMS banner

FitGear: Anniversary Email & SMS

An anniversary reward where the discount (10% to 30%) is set by each customer's yearly spend and basket size, and stays the same across email and the SMS reminder.

Email + SMS · LoyaltyAMPscriptEmailSMSScenario-based build
01 · The result

What subscribers actually receive

Swipe to compare →
Customer 1001 · John20% off
Subject: John, Happy 1 year! We have a special gift for you
Email preview for Customer 1001 · John
Customer 1002 · Sarah30% off
Subject: Sarah, Happy 1 year! We have a special gift for you
Email preview for Customer 1002 · Sarah
Customer 1003 · no first name10% off
Subject: Happy 1 year! We have a special gift for you
Email preview for Customer 1003 · no first name
Three customers, three different rewards and three different thank-you messages, all from one email.

The SMS reminder

SMS previewSMS previewSMS preview

The SMS reminder for anyone who hasn't redeemed after 7 days uses the same logic, so the offer always matches the email.

02 · How I built it

The logic, in plain English

  • Looked up yearly spend and average basket size from MarketingCustomerView with Lookup.
  • Nested IF / ELSEIF logic maps nine spend and basket combinations to a discount and a reference code.
  • The message changes with basket size too, so the biggest spenders get a different thank-you.
  • Reused the same logic in the SMS, with a short redemption link built from the discount reference.
03 · Under the hood

Spend and basket size decide the reward

A short excerpt. The full code and the brief's requirements are on GitHub.

AMPscript01-Anniversary-Email.ampscript
/* RETRIEVE CUSTOMER SPENDING DATA */
SET @TotalYearlySpend = Lookup("MarketingCustomerView", "TotalYearlySpend", "CustomerID", @cusID)
SET @AvgBasketSize = Lookup("MarketingCustomerView", "AvgBasketSize", "CustomerID", @cusID)

/* DISCOUNT OFFER DETERMINATION */
IF @TotalYearlySpend <= 499 THEN
   IF @AvgBasketSize <= 49 THEN
      SET @Discount = 10
      SET @DiscountRef = "GTUI90"
   ELSEIF @AvgBasketSize <= 99 THEN
      SET @Discount = 15
      SET @DiscountRef = "TGI782"
   ELSE
      SET @Discount = 20
      SET @DiscountRef = "THP892"
   ENDIF
ELSEIF @TotalYearlySpend <= 999 THEN
   /* ... same pattern, 15% to 25% ... */
ELSE
   /* ... same pattern, 20% to 30% ... */
ENDIF

/* DYNAMIC LINK TO REDEEM OFFER */
SET @link = Concat("fitgear.com/redeem?code=", @DiscountRef)

Have a campaign, role, or idea in mind?

I'd love to hear from you.