Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.
/ mailer Public archive

📫 Mailer is a app to send form submissions by email

License

Notifications You must be signed in to change notification settings

IgorKowalczyk/mailer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Jekyll Node.js Workflow GitHub License Version Discord

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

Deploy 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 in form.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