I have to pass Email in URL parameter of Unsubscribe link from Email.
Since PII should not appear in URL so i want to encode it. I have written below ampscript:
%%[
var @clientkey, @clientkeyencoded, @URLunsubscribe,@enc64
SET @clientkey = SubscriberKey
SET @clientkeyencoded = URLencode(@clientkey,1,1)
SET @URLunsubscribe = Concat("http://example.com/unsubscribe/?sk=",@clientkeyencoded)
]%%
and Passing in Email like:
href="%%=v(@URLunsubscribe)=%%"
But Issue: once i click on link it's not showing the encoded parameter and Error page is showing
"Bad Request - Invalid URL" "HTTP Error 400. The request URL is invalid."