This repository is outdated. Do not use it on production!
It is a simple Node.js server which forwards all "POST" submission by email. No database, 100% server (Nodejs), just sends the submissions by email.
You create your front-end and style. Let's build anything you want, we'll take the backend!
<form action="https://YOUR-DEPLOYED-APP/post" method="post" enctype="multipart/form-data">
<label for="Email">Email
<input id="Email" type="email" name="Email" required="true">
</label>
<label for="Name">Name
<input id="Name" type="text" name="Name" required="true">
</label>
<input type="submit" value="Send">
</form>
Note: Whether you add a
/post
or another endpoint, the app will always handle your request
Deploy the app to Heroku
Here are all the environment variables you can use
.env |
Description | Required |
---|---|---|
MESSAGE | Message to displayed after the form submission. May contain HTML. Default: 'Thank you for your submission.' | ✔️ |
TO | Email address to send the form to (your email) | ✔️ |
FROM | Email address to use as sender address | ✔️ |
SITE_NAME | Name of your site, will be displayed in the email title | ❌ |
PORT | Port to listen to for form submissions | ❌ |
FORM | Path to the HTML file containing the example form, defaults to /form.html |
❌ |
EMAIL_HOST | SMTP config: see these options here | ✔️ |
EMAIL_PORT | SMTP config: see these options here | ✔️ |
EMAIL_USER | SMTP config: see these options here | ✔️ |
EMAIL_PASS | SMTP config: see these options here | ✔️ |
- First you must fill
.env
config with your values
$ npm install
$ EMAIL_USER="john@doe.com" \
EMAIL_PASS="abcd" \
EMAIL_HOST="mail.host.net" \
EMAIL_PORT=587 \
TO="jahne@doe.com" \
npm start
- Open
http://localhost:8080
to see the HTML form which resides inform.html
. Submit the form and it will send you an email with the content of the form. - You can customize the form, it will keep sending you all the field of the form by email.
To set up your environment to develop this page, run bundle install
.
To test site, run bundle exec jekyll serve
and open your browser at http://localhost:4000. This starts a Jekyll server using your config and the contents. As you make modifications, your site will regenerate and you should see the changes in the browser after a refresh.
If you have any issues with the page please create new issue here
When submitting a pull request:
- Clone the repo.
- Create a branch off of master and give it a meaningful name (e.g. my-awesome-new-feature).
- Open a pull request on GitHub and describe the feature or fix.
This project is licensed under the MIT. See the LICENSE file for details