I have an email from email studio go to a group of contacts. The name of the data extension is called "SmartCapture". On the email, when a person clicks the submit button, he or she will then be taken to a cloud page.
I'm wanting to capture the person's email from the email after the button is clicked and then pre-populate the email address field with what was pulled from the button click.
So the process would look like this: Email received -> take survey button clicked on the email -> email address captured -> person lands on cloud page where they see their email already on the landing page.
So far I have the following built but it is not working. May I have help with where I am going wrong?
Below is stored on the email: %%[ Var @link Set @link = Concat('https://fe3715717564047b731274.pub.s11.sfmc-content.com/uujkvwp3qzv/emailaddr=', AttributeValue('emailaddr')) ]%%
CTA Button
%%[
Var @link
Set @link = Concat('https://fe3715717564047b731274.pub.s11.sfmc-content.com/uujkvwp3qzv/emailaddr=', AttributeValue('emailaddr'))
]%%
<a href="%%=RedirectTo(@https://fe3715717564047b731274.pub.s11.sfmc-content.com/uujkvwp3qzv)=%%">CTA Button</a>
Stored on the cloud page: var queryString = window.location.search; var params = new URLSearchParams(queryString.substring(1)); // drops the leading "?" var username = parseInt(params.get('emailaddr'));
var queryString = window.location.search;
var params = new URLSearchParams(queryString.substring(1)); // drops the leading "?"
var username = parseInt(params.get('emailaddr'));