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 iStart the development server and mjml. watcher (typically on localhost:5173)
npm run devStart templating your email in the src directory.
Build the email template to the dist directory
npm run buildPreview the email build in the browser
npm run previewRun the TypeScript test
npm run testFormat code with Prettier
npm run formatTo 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 .envFill in the required SMTP credentials, and email addresses.
Then run the following command to send a test email:
npm run send:mail