This is a FERN-stack app to programatically send responsively-designed emails with nodemailer + mjml templates
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
All dependencies listed in package.json
.
Create a firebase project for authentication and user data permanence. This project currently supports Nodemailer SMTP connection to gmail.com or AWS SES send email and thus requires a Gmail account or AWS account with a non-sandboxed SES to operate.
Create a folder named data
in the root directory to store MJML templates to transpile, inject, and send. See below for example.mjml
:
<mjml>
<mj-body>
<mj-section>
<mj-column>
<mj-text font-size="20px" color="red">Hello World</mj-text>
</mj-column>
</mj-section>
</mj-body>
</mjml>
Create a .env in the root directory with the following:
PORT=3000
FIREBASE_API_KEY='YOUR_API_KEY_HERE'
FIREBASE_AUTH_DOMAIN='YOUR_AUTH_DOMAIN_HERE'
FIREBASE_DB_URL='YOUR_DB_URL_HERE'
FIREBASE_PROJECT_ID='YOUR_PROJECT_ID_HERE'
To install dependencies
npm install
To run server
npm start
To run webpack
npm run react-dev
To run tests
npm test
To send an email with dotmail just POST to /api/send
with well-formed JSON:
curl -d 'EXAMPLE_JSON_BODY' -H "Content-Type: application/json" -X POST http://localhost:3000/api/send
EXAMPLE_JSON_BODY
{
"form": {
"id": 0,
"name": "Example",
"type": "universal",
"subjectLine": "Example subject line",
"injections": [
{
"name": "exampleInjection",
"type": "text",
"data": "This is an example"
}
]
},
"currentUser": { "name": "John Smith", "email": "[email protected]" },
"recipients": [
{
"firstName": "exampleFirstName",
"lastName": "exampleLastName",
"preferred": "examplePreferredName",
"email": "[email protected]"
}
]
}
http://dotmail.tech is our application's home!
- Firebase - The OAuth and real-time database
- React.js - The front-end MVC framework
- Redux - The state management
- Express - The server
- Node.js - The back-end
- Mustache - The logic-less template system
- MJML - The framework that makes responsive email easy
- Jest - The testing framework
- Enzyme - The testing utilities
- SuperTest - The http integration testing
- Docker - The package/container management
- AWS SES - The flexible and highly-scalable email sending and receiving platform
- AWS EC2 - The secure and resizable compute capacity in the cloud
We use Git for versioning.
Our Trello Board - Check out what we're working on next
-
Nicholas Vincent-Hill - Nicholas Vincent-Hill
-
Fernando De La Madrid - Fernando De La Madrid
This project is licensed under the MIT License - see the LICENSE.md file for details