Skip to content

...because I didn't want to run an entire server just to send some emails from a simple static website.

Notifications You must be signed in to change notification settings

jpswade/serverless-contact-form

Repository files navigation

Serverless Contact Form (using AWS Lambda)

by James Wade

...because I didn't want to run an entire server just to send some emails from a simple static website.

About

It's a simple serverless solution that uses AWS Lambda functions to handle POST requests coming from a contact form on your static website (ie: Hosted on S3/Cloudfront).

It uses Amazon SES to send the emails.

It's based on Lambda-Contact by Jason Pope.

Preface

This a "proof of concept" and probably not considered "ready for prime time" yet.

I want to see if it was possible, the good news is, it is, the bad news is, you'll likely want to handle bots and spam.

Consider this as a place to start.

Getting started

Install

You'll need the serverless framework:

brew install severless

  1. This will install the node modules needed:

npm install

  1. Rename "config.json.example" to "config.json" and set your configurations.

cp config.json.example config.json

Run

Lifecycle scripts included in serverless-contact-form:
  test
    sh test.sh

available via `npm run-script`:
  offline
    AWS_REGION=eu-west-1 sls offline start --stage dev
  deploy
    sls deploy

Test

Run npm run offline, then use test.sh or example.html to test it works.

Roadmap

  • Spam protection
  • Improve data handling

About

...because I didn't want to run an entire server just to send some emails from a simple static website.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published