Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/antoinerousseau/form-to-ses
Receive POST data and send them through Amazon SES (ideal for contact forms)
https://github.com/antoinerousseau/form-to-ses
Last synced: about 4 hours ago
JSON representation
Receive POST data and send them through Amazon SES (ideal for contact forms)
- Host: GitHub
- URL: https://github.com/antoinerousseau/form-to-ses
- Owner: antoinerousseau
- Created: 2016-03-16T18:41:27.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-28T11:25:42.000Z (over 7 years ago)
- Last Synced: 2024-09-22T09:47:29.814Z (about 2 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Contact form to Amazon SES
Receive POST data and send them through Amazon SES (ideal for contact forms)
## Setup
Prerequisites:
* [Node.js](http://nodejs.org/)
* An [Amazon SES](https://aws.amazon.com/ses/) accountRetrieve dependencies:
npm install
Configure:
cp config.dist.json config.json
Then edit `config.json` to setup your app:
* `region`: your Amazon SES account region
* `access_key_id` and `secret_access_key`: your Amazon AWS credentials
* `from`: the sender email address of the emails you will receive (it *must* be [verified](http://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-email-addresses.html)). You can use the `[origin]` placeholder, which will be replaced by the hostname of your form, or `[domain]` for the domain name (origin root).
* `to`: your email address(es)
* `default_subject`: used if your visitor did not provide a subject to their message (or if you did not provide a `subject` field)
* `allowed_origins` (optional): hostnames allowed to post (no port)
* `rollbar_token` (optional): your [Rollbar](https://rollbar.com/) Project Access Token (usually the _post_server_item_)## Start
./server.js
Or daemonize:
npm install -g pm2
PORT=3000 pm2 start server.js --name "form-to-ses" -- --color## Use
Your contact form should look like this:
```html
Send```
If the mail is successfully sent to you, the user will be redirected to the page specified in the `success` input field.
If an error happens, the user will be redirected to the page specified in the `error` input field, with the reason as a `reason` parameter in the URL query. If you have plugged a Rollbar account, you will find more information there.