I have a Microsite in Classic Content that works perfectly.
It is a form that does a look-up against a data extension, and displays dynamic content to the user.
The user is able to make selections in radio-buttons (it is a preference centre) and submits the form. That data is then written to the data extension, and the form redirects them to a confirmation page.
This all works PERFECTLY in Microsites, but I have found out that I can't link to a microsite in an email if the customer is using the Gmail webclient on a computer (it works fine in the Gmail app for some reason).
I figured this might be a good time to transition to CloudPages, so I created 2 new pages, copy and pasted the AMPscript and HTML from my Microsite pages, and changed the redirect code on submit to:
IF RequestParameter('UpdatePref') == "1" THEN SET @CID = _SubscriberKey SET @Interest1 = RequestParameter("Int_1") SET @Interest2 = RequestParameter("Int_2") UpsertDE("Preference_Centre_Interest", 1, "CNSMR_ID", @CID, "Interest_1", @Interest1, "Interest_2", @Interest2, "UPDATE_DATE", NOW()) /* Redirect to thank you page */ RedirectTo(CloudPagesURL(399)) ENDIF
And that is based on the same button code I use on the Microsite:
<button type="submit" value="1" name="UpdatePref" style="color: #00305E; text-decoration: none; text-transform:uppercase; padding-top: 10px; padding-bottom: 10px; padding-left: 50px; padding-right: 50px; font-family: 'Roboto', Verdana, Arial, Helvetica, sans-serif; font-size:16px; line-height:24px;" valign="middle" bgcolor="#FFFFFF" class="bg-rollover"> <strong>SUBMIT</strong> </button>
Linking to a CloudPage from the Gmail web client works fine (great!) but now the form doesn't work as it should.
Clicking submit just refreshes the page, and no data is written anywhere.
As a guess, I think the submit function to refresh the form and trigger the IF statement to do the upsert and redirect isn't working, but I don't understand why as it is exactly the same code as I have in my working Microsite.
Has anybody got this working and knows where I may have gone wrong?