1

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

]%%
  • You should use AttributeValue("emailaddr") instead of AttributeValue("EmailAddress") to be sure you always get the email address, even though it is stored in a column with a different name in sendable data extension. – Lukas Lunow Jan 28 at 12:37
  • Thanks Lukas, I did those changes. The issue still persists though. – Shantanu Punekar Jan 28 at 15:00
  • Can you update your question with a screenshot of your coupons data extension? – Adam Spriggs Jan 29 at 16:43
  • Thanks Adam for expressing interest to help! But I figured out there was no issue with this AMP Script, rather I created another Email and a Trigger send and it worked fine. Still unknown though what was causing it to not work. – Shantanu Punekar Jan 30 at 17:09
  • I couldn't figure out what the issue was, but I created a new Trigger Send and it worked well. – Shantanu Punekar Feb 17 at 16:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.