We have a marketing cloud email link with <a href="mailto:">
When the link is clicked along with allowing the customer to email us, we also want to pass parameters to a cloud page (they should not see the cloud page part so it should happen in the background)
Essentially, we want to record the click into a DE which will be used for suppression.
Below is my code in the email and cloud page which isn't working. I feel i am not approaching this the right way. Can this be done differently?
Email html content block
%%[
Set @cno = AttributeValue("customer")
Set @appnum = AttributeValue("applicationNumber")
Set @cloudPageURL = RedirectTo(CloudPagesURL(92, 'cno', @cno, 'appnum', @appnum))
]%%
%%[
set @scriptBeg = Concat('<','script','>')
set @scriptEnd = Concat('<','/','script','>')
]%%
<a href=“mailto:[email protected]?subject=some subject" onclick="redirectToCloudPage()">
<span>I am interested</span>
</a>
%%=v(@scriptBeg)=%%
function redirectToCloudPage() {
window.location.href = "%%=v(@cloudPageURL)=%%";
}
%%=v(@scriptEnd)=%%
My code in the cloud page (92)
%%[
set @cno = Requestparameter('cno')
set @appnum = Requestparameter('appnum')
set @response = "I am interested"
UpsertDE("Responses",1,"ApplicationNumber",@appnum,"Customer",@cno,"Response",@response)
]%%