-1

After the Form submits success, The Page is not redirected to the Thankyou Page, In the console, I have got an Error response as Redirects not supported in AMP4Email.​​​ Please let me know when the Redirect Feature will work.

We are using <html ⚡4email>.

And in Php, I have added the Redirect Headers

$redirect_url = 'https://example.com/amp/nextown/thankyou.amp.html';
header("Access-Control-Expose-Headers: AMP-Access-Control-Allow-Source-Origin, AMP-Redirect-To");
header ('AMP-Redirect-To: '.$redirect_url);
Simone Rossaini
  • 8,115
  • 1
  • 13
  • 34
  • Does this post https://stackoverflow.com/questions/43422257/amp-form-submission-redirect-or-response answer or get you closer to the solution? – hppycoder Mar 24 '21 at 13:03

1 Answers1

1

The feature as advertised in the AMP for website documentation will never work in emails. It's banned for security reasons: we don't want email senders to be able to redirect the email iframe (the container for the email body) or the top-level email client frame (e.g., https://mail.google.com if the user is using Gmail) to a new page.

There's an alternative proposal of opening the "redirect" URL in a new browser tab instead of redirecting the current page. However, no one has yet been able to provide a solution for the implementation challenges mentioned in the issue.

Su Zhang
  • 2,155
  • 2
  • 14
  • 11