Git Product home page Git Product logo

react-email's Introduction

React Form Email

License

Build a React form and send its content by email. Uses react-html-email to build emails with React, not tables! Supports attachments and inline images.

See a live version and sell your camera gear at cameraventures.com/buy

Getting started

Install the app with npm install. Before you run the app, configure the following environment variables:

[email protected]
[email protected]
GMAIL_PASSWORD=supersecret

Finally run the app with npm run start.

Tip: In local development you can define the above environment variables while starting the app:

[email protected] [email protected] GMAIL_PASSWORD=supersecret npm run start

Configuring

Mail settings

This app uses Nodemailer to send emails. It is configured to use Gmail as a sender, but you can use a transport of your choice by editing server/routes/mail.js. Refer to the Nodemailer docs to set things up.

When using a Gmail transport you may notice that messages do not get delivered. This is most likely due to Google blocking your app from accessing the specified Gmail user's account. To remedy this, go through the following steps.

  1. Let less secure apps use your account.
  2. Allow your new app access to your account.

Each time you deploy code, Google sees your app as a "new app". You will need to redo the second step after each deployment unless you set up an app-specific password. I have yet to test this method myself so let me know if it works!

Layout

The following are places you can start to configure what things look like. To customize the form itself, edit client/src/App.js. To customize the email that gets sent, edit client/src/Components/Mailer.js.

Deploying

Heroku deployment scripts are included. Simply create a Heroku app through the CLI with heroku create your-app-name and run git push heroku master. Remember to set the environment variables on Heroku as well!

heroku config:set [email protected]
heroku config:set [email protected]
heroku config:set GMAIL_PASSWORD=supersecret

react-email's People

Watchers

Bruno avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.