1

I'm trying to figure out how to pass a coupon value to a Cloud Page from an email deployed via SFMC. I'm definitely a neophyte when it comes to this stuff, but this can't be that hard?!?!

After reading the online documentation I figured I would use a combination of a PURL and AMPscript as I'm comfortable with AMPscript

For whatever reason I can't get the coupon code to display. I've tried the following in the cloud page:

%%[ SET @couponID = LookUp("Coupons","CouponCode","EmailAddress",emailaddr) ]%%
    %%=v(@couponID)=%%

and in the email, I have the cloud page URL with the appropriate URL string:

?emailaddress=%%emailaddr%%  

The Coupon Code is definitely populating into the email, I just can't get it to display on the Cloud Landing Page. I know there's a SSJS way to do this, but I don't know SSJS.

1 Answer 1

2

Your major issue is that the emailaddr is blank, so your lookup will fail. I would not recommend using the string emailaddr is outside of email creatives.

You are using a parameter to pass the value, so you would need to request this parameter and then set the variable in your lookup.

See below:

 %%=[  
      SET @EmailAddress = RequestParameter("emailaddress")
      SET @coupoonID = LookUp("Coupons", "CouponCode", "EmailAddress", @EmailAddress)
  ]%%
2
  • This is exactly what I needed. Thank you. It's always a simple oversight, isn't it? Mar 17, 2017 at 15:03
  • Glad to have helped! If you feel this has solved your issue, please feel free to click the check mark next to this answer to mark it as accepted. Mar 17, 2017 at 15:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .