Power your website contact form with this NodeJS app. Clone the repo, fill out the config file and go.
Q: another contact form app? seriously? A: I was paranoid about using free "we probably won't steal all emails sent through this form" services and didn't want to install PHP.
contact-form-backend is designed for situations where you already have an HTML form and just need a server-side program to handle the data. If you need the full package with a frontend form, you can still use this app, but be aware that you'll need to make your own frontend. I included an example frontend.
You'll need a server running node >= 6.x, a Recaptcha key (for blocking spam) and an Amazon SES account (for sending emails).
Also, you'll need an HTML contact form that uses Recaptcha. You can see an example form at views/index.ejs
- Clone or fork this repo onto your server
- Copy
config/example.json
toconfig/local.json
and fill in all fields. Remember to verify the source and destination addresses with SES. - Run the app with
npm start
- Configure your contact form HTML to provide these fields:
email
(string, valid email);name
(string);message
(string), recaptcha. See the example form:views/index.ejs
- POST your form to
<server address>:3000/send
- Backend delivers 204 on success, 400 on missing or invalid parameters
- Every time a user fills out your contact form, the app will send an email to the configured destination address.
npm test
(unix) or set NODE_ENV=test&&mocha
(windows)
After installation, visit http://localhost:3000 to view an example contact form. Source: views/index.ejs