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.’ | :heavy_check_mark: |
TO | Email address to send the form to (your email) | :heavy_check_mark: |
FROM | Email address to use as sender address | :heavy_check_mark: |
SITE_NAME | Name of your site, will be displayed in the email title | :x: |
PORT | Port to listen to for form submissions | :x: |
FORM | Path to the HTML file containing the example form, defaults to /form.html |
:x: |
EMAIL_HOST | SMTP config: see these options here | :heavy_check_mark: |
EMAIL_PORT | SMTP config: see these options here | :heavy_check_mark: |
EMAIL_USER | SMTP config: see these options here | :heavy_check_mark: |
EMAIL_PASS | SMTP config: see these options here | :heavy_check_mark: |
.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
http://localhost:8080
to see the HTML form which resides in form.html
. Submit the form and it will send you an email with the content of the form.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:
This project is licensed under the MIT. See the LICENSE file for details