An email templating starter package using mjml. for templating and Vite for development.
Useful resources:
Node.js 20 installed on your machine
See Node.js or preferably use NVM (Node Version manager)
Install Node.js dependencies
npm i
Start the development server and mjml. watcher (typically on localhost:5173)
npm run dev
Start templating your email in the src
directory.
Build the email template to the dist
directory
npm run build
Preview the email build in the browser
npm run preview
Run the TypeScript test
npm run test
Format code with Prettier
npm run format
To allow Prettier to format your code on save, configure your editor:
Prettier Editor Integration
ℹ️ Ensure to include .mjml
files in your editor's Prettier configuration
It is possible to send test emails of a build. It requires to set up a .env
according to the .env.example
file.
cp .env.example .env
Fill in the required SMTP credentials, and email addresses.
Then run the following command to send a test email:
npm run send:mail