https://github.com/peter-neumann-dev/mjml-email-starter
An email templating starter package using MJML for templating and Vite for development.
https://github.com/peter-neumann-dev/mjml-email-starter
Last synced: 11 months ago
JSON representation
An email templating starter package using MJML for templating and Vite for development.
- Host: GitHub
- URL: https://github.com/peter-neumann-dev/mjml-email-starter
- Owner: peter-neumann-dev
- License: mit
- Created: 2024-05-02T13:45:30.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-10T09:15:21.000Z (about 2 years ago)
- Last Synced: 2024-12-29T03:49:35.420Z (over 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 60.5 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# mjml. Email Starter Package
[](https://mjml.io/)
[](https://vitejs.dev/)
[](https://www.typescriptlang.org/)
[](https://nodejs.org/)
[](https://www.npmjs.com/)

## đ About
An email templating starter package using [mjml.](https://mjml.io/) for templating and [Vite](https://vitejs.dev/) for development.
**Useful resources:**
- [mjml. Documentation](https://mjml.io/documentation/)
- [Can I email](https://www.caniemail.com/)
- [Litmus Email Testing (paid)](https://www.litmus.com/email-testing)
### đ§ Requirements
**Node.js 20 installed on your machine**
See [Node.js](https://nodejs.org/) or preferably use [NVM (Node Version manager)](https://github.com/nvm-sh/nvm)
## đ Quick Start
Install Node.js dependencies
```bash
npm i
```
Start the development server and mjml. watcher (typically on [localhost:5173](http://localhost:5173))
```bash
npm run dev
```
Start templating your email in the `src` directory.
## đĻ Build
Build the email template to the `dist` directory
```bash
npm run build
```
Preview the email build in the browser
```bash
npm run preview
```
## đ§° Tools
Run the TypeScript test
```bash
npm run test
```
Format code with Prettier
```bash
npm run format
```
To allow Prettier to format your code on save, configure your editor:
[Prettier Editor Integration](https://prettier.io/docs/en/editors)
âšī¸ **Ensure to include `.mjml` files in your editor's Prettier configuration**
## đ¤ Sending Test Emails with SMTP
It is possible to send test emails of a build. It requires to set up a `.env` according to the `.env.example` file.
```bash
cp .env.example .env
```
**Fill in the required SMTP credentials, and email addresses.**
Then run the following command to send a test email:
```bash
npm run send:mail
```