0

I am trying to pass the email value from a data extension to HTML. I am using the CloudPagesURL() in my email in attempt to grab the subscriber's email.

Here is my code syntax that I am attempting to use:

Email Code:

<p><a title="MyPage" href="%%=RedirectTo(CloudPagesURL(505,'Email Address',@EmailAddress))=%%" alias="ThisAlias" conversion="false">Click to unsubscribe page 505</a></p>

CloudPage AMPScript Code:

%%[

VAR @emailAddress

SET @emailAddress = RequestParameter("emailaddr")

]%%

Cloudpage HTML Code:

<td width='155' valign='bottom'><input type='text' name='Name1' value='%%=v(@emailAddress)=%%' id='Name1' /></td>

Any reason as to why this doesn't work? My syntax might just be wrong or I might be using the CloudPagesURL() function incorrectly.

1 Answer 1

0

You don't need to append the email address in your email. It already exists in the built-in send context via the emailaddr personalization string.

Email:

<a href="%%=RedirectTo(CloudPagesURL(505))=%%">Click to unsubscribe page 505</a>

Page:

%%[

VAR @emailAddress

SET @emailAddress = AttributeValue("emailaddr")

]%%
2
  • Thanks! That seemed to work. Do you know if there is a function within AMPScript or SSJS that can grab the whole URL at the top and set it to a variable? Commented Jun 21, 2018 at 15:25
  • Yes. For SSJS, there's an undocumented variable called Platform.Request.RequestURL and in AMPscript it's RequestParameter('PAGEURL') Commented Jun 21, 2018 at 16:42

You must log in to answer this question.

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