简体   繁体   中英

AMP Form doesn't redirect to thankyou after form submit

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);

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 (eg, 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM