Hi,
I tried to use Marketo tokens in the follow-up URL but it seems it only allows my.tokens. And since we can't use tokens inside tokens.
Is there a way I can send the email of a person in the follow-up URL, like https://www.google.com/?email=aaa@bbb.com
Thanks!
Solved! Go to Solution.
Just use the email script token for this. Make sure you output the fully formed hyperlink (<a> through </a>) from the email script token instead of outputting the URL (https://www.google.com/?email=aaa@bbb.com) alone.
<a href="https://www.google.com?email=${esc.url($lead.Email)}">ABC</a>
Also, just putting it out here that I'm not a fan of putting PII in the URL. Is there any alternate way you could avoid this?
Edit- This solution applies for including Email Address in the URL within an email asset.
I assume you don’t mean “send” (as in sending a separate email) but actually “append to the query string”, correct?
This is simple:
MktoForms2.whenReady(function(readyForm){
readyForm.onSuccess(function(submittedValues, originalThankYouHref){
const thankYouURL = new URL(originalThankYouHref);
thankYouURL.searchParams.set("email", submittedValues.Email);
document.location.href = thankYouURL.href;
return false;
});
});
I share Darshil’s misgivings about include PII in the URL but if your destination page requires it there’s no avoiding it.
Just use the email script token for this. Make sure you output the fully formed hyperlink (<a> through </a>) from the email script token instead of outputting the URL (https://www.google.com/?email=aaa@bbb.com) alone.
<a href="https://www.google.com?email=${esc.url($lead.Email)}">ABC</a>
Also, just putting it out here that I'm not a fan of putting PII in the URL. Is there any alternate way you could avoid this?
Edit- This solution applies for including Email Address in the URL within an email asset.
Thanks Darshil, that helps a lot and believe me, we didn't want to do this, but we are having issues with Heap to recognize email, so our workaround for now will be doing this.
I assume you don’t mean “send” (as in sending a separate email) but actually “append to the query string”, correct?
This is simple:
MktoForms2.whenReady(function(readyForm){
readyForm.onSuccess(function(submittedValues, originalThankYouHref){
const thankYouURL = new URL(originalThankYouHref);
thankYouURL.searchParams.set("email", submittedValues.Email);
document.location.href = thankYouURL.href;
return false;
});
});
I share Darshil’s misgivings about include PII in the URL but if your destination page requires it there’s no avoiding it.
Yeah that "Send" was to append the value to the query string, thanks Sanford!
oh javascript solution! Nice, thanks!