https://github.com/thestackshack/serverless-contact-us-form
Simple Contact Us form for static websites
https://github.com/thestackshack/serverless-contact-us-form
Last synced: 12 months ago
JSON representation
Simple Contact Us form for static websites
- Host: GitHub
- URL: https://github.com/thestackshack/serverless-contact-us-form
- Owner: thestackshack
- Created: 2017-08-17T20:01:39.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-21T12:36:07.000Z (over 8 years ago)
- Last Synced: 2024-11-04T06:34:48.193Z (over 1 year ago)
- Size: 5.86 KB
- Stars: 20
- Watchers: 5
- Forks: 47
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-starred - thestackshack/serverless-contact-us-form - Simple Contact Us form for static websites (others)
README
# Serverless Contact Us Form
The template: [cloudformation.yml](cloudformation.yml)
Quickly deploy an endpoint to handle your `contact us` form on your static website. We don't want to have servers running just to handle our `contact us` form which rarely gets invoked. Oh, and we also need Captcha because we don't have time in our lives for spam.
You can get your reCAPTCHA secret here: https://www.google.com/recaptcha/admin#list
## What AWS resources does this template use?
* Lambda (API Function)
* API Gateway (HTTP proxy to Lambda)
* S3 (Lambda files)
* SES (Send us the email)
* CodeCommit (GIT repo)
* CloudFormation (Infrastructure as Code)
* IAM (AWS permissions & users)
## HTML Form
```
Name
Email address
Phone number
Message
Thanks! We'll contact you soon.
Submit
```
JQuery example...
```
$.post($("#contact-us-form").attr('action'), JSON.stringify({
name: $("#contact-us-form input[name='name']").val(),
email: $("#contact-us-form input[name='email']").val(),
phone: $("#contact-us-form input[name='phone']").val(),
message: $("#contact-us-form textarea[name='message']").val(),
'g-recaptcha-response': $("#contact-us-form textarea[name='g-recaptcha-response']").val()
}), function (data) {
$(".thanks").show();
$("#contact-us-form button").hide();
}, 'json');
```
