Skip to content

Instantly share code, notes, and snippets.

@Stefany93
Created June 26, 2019 15:55
Show Gist options
  • Save Stefany93/a946d558206cd183ab3ceff091724998 to your computer and use it in GitHub Desktop.
Save Stefany93/a946d558206cd183ab3ceff091724998 to your computer and use it in GitHub Desktop.
AMP subscription form
<form
action-xhr="https://fabulousnewwebsite.com/scripts/subscriber_process.php"
verify-xhr="https://fabulousnewwebsite.com/scripts/subscriber_process.php"
method="post"
custom-validation-reporting="show-all-on-submit"
class="mb3"
>
<label class="center">
Email:
<input type="text"
name="subscriber_email" >
</label>
<div class="center">
<input type="submit" value="Subscribe!">
</div>
<div submit-error>
<template type="amp-mustache">
{{#verifyErrors}}
<p style="background:#ff4c4c;color:white;text-align: center;">
{{message}}
</p>
{{/verifyErrors}}
{{^verifyErrors}}
<p style="background:#ff4c4c;color:white;text-align: center;">Something went wrong!
Couldn't subscriber you to the newsletter! </p>
{{/verifyErrors}}
</template>
</div>
<div submit-success>
<template type="amp-mustache">
<p style="background:green;color:white;">Thank you for subscribing to our newsletter!</p>
</template>
</div>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment