|var @em, @couponRow, @couponCode|
|if _messagecontext == "PREVIEW" then|
|set @couponCode = "XX TEST XX"|
|/* include your sendable attribute/column here */|
|set @em = AttributeValue("emailAddr")|
|set @couponRow = ClaimRow("CouponsCodes", "IsClaimed", "EmailAddress", @em)|
|if empty(@couponRow) then|
|/* You can do other error handling here if you want.*/|
|/* This aborts the send */|
|RaiseError("No coupons available", false)|
|SET @couponCode = Field(@couponRow, "CouponCode")|
|Here's your coupon code: %%=v(@couponCode)=%%|
This is really helpful. Thanks for writing up!
Is it possible to supply a unique code to a recipient and then to push it into an intent tweet via AMPScript?
So for example, a recipient would receive their code in an email and then click a 'tweet now' button where a prewritten tweet would display with their unique code in a message.