I have created an Interactive Form email, in which I have added Fallback content as Freeform block.
Fallback content has a button, from where I'm passing the values in emailaddr
& _subscriberkey
.
href="%%=RedirectTo(CloudPagesURL(xxx, 'Email', emailaddr, 'SubscriberKey', _subscriberkey))=%%"code to
-Cloud page code contains the code to retrieve the values using Requestparameter
function. I have added my code below.
When I click on the button it takes me to Cloudpage. However, when I click on submit button I get 500 internal server error.
%%[
set @subscriberkey = _subscriberKey
set @Email = emailaddr
if RequestParameter("submitted") == true then
set @Q1 = RequestParameter("Q1")
set @Q2 = RequestParameter("Q2")
Set @Q3 = RequestParameter("Q3")
InsertData('MyDE','Email',@Email, 'Q1', @Q1, 'Q2', @Q2, 'Q3', @Q3, 'SubscriberKey',@subscriberkey, 'AddedDate',Now())
endif
]%%
%%[ if RequestParameter("submitted") == true then ]%%
<p align="center" style="font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 18px; color: #fffff; padding:0px 0px 10px 0px;"><b>Thank you.</b></p>
%%[ else ]%%
<h1 align="center" style="font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; color: #fffff; padding:0px 0px 10px 0px;">We Value your feedback.</h1>
<form action="http://cloud.xxx.xxxx.com/xxx" method="post" id="MyForm" align="center" style="font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; color: #fffff; padding:0px 0px 15px 0px;">
<p align="left" style="font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; color: #fffff; padding:0px 0px 10px 0px;"> <label class="checkbox-inline">
<input type="checkbox" id="Q1" name="Q1" value="True">1. abcdefg
</label> <br>
<label class="checkbox-inline">
<input type="checkbox" id="Q2" name="Q2" value="True">2. hijklm
</label><br>
<label class="checkbox-inline">
<input type="checkbox" id="Q3" name="Q3" value="True">3. nopqrst
</label>
<br></p>
</form>
<p align="center" style="font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; color: #fffff; padding:0px 0px 10px 0px;">
<button type="submit" form="MyForm" name="submitted" value="true">SUBMIT</button></p>
%%[ endif ]%%
I Need help to understand if I'm missing something here.