← All projects
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.
01 · The result


What subscribers actually receive
Swipe to compare →Three customers, three different rewards and three different thank-you messages, all from one email.
The SMS reminder



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 / ELSEIFlogic 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)



