This repository is outdated. Do not use it on production!
Mailer
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.
How to use?
You create your front-end and style. Let's build anything you want, we'll take the backend!
Example form
<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
Deploy the app to Heroku
Config
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 | βοΈ |
Development
Node.js Version
- 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.
Jekyll Version (Docs)
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.
Issues
If you have any issues with the page please create new issue here
Pull Requests
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.
License
This project is licensed under the MIT. See the LICENSE file for details