I have build a cloud page where we are asking contacts to fill in the form and once the form is filled, we will be sending an email to same email address provided in form with the Coupon Codes. I have created a 'Thank You Page' which is displayed after filling in the form, this page has a SSJS which triggers the email. The issue is, when the email is received it does not renders the Coupon Code and that column is blank. I am not able to figure out how, since I have another similar email and respective cloud page with triggered send which works perfectly fine.
%%[ var @em1, @couponRow1, @couponCode1 if _messagecontext == "PREVIEW" then set @couponCode1 = "XXX" else set @em1 = AttributeValue("EmailAddress") set @couponRow1 = ClaimRow("CouponCodesDE", "IsClaimed", "EmailAddress", @em1) if not empty(@couponRow1) then set @couponCode1 = Field(@couponRow1, "CouponCode") else RaiseError("No coupons available", false) endif endif ]%%