Skip to content

Commit

Permalink
chore: set up mjml for building email templates
Browse files Browse the repository at this point in the history
  • Loading branch information
huwshimi committed Sep 20, 2024
1 parent 11c0f88 commit 24022e8
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/mail/.mjmlconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"options": {
"minifyOptions": {
"minifyCSS": true
}
},
"packages": []
}
8 changes: 8 additions & 0 deletions internal/mail/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
MJML=npx mjml
MJML_FILES=$(wildcard mjml/*.mjml)
HTML_DIR=html

build:
$(foreach file, $(MJML_FILES), $(MJML) $(file) --config.minify --config.useMjmlConfigOptions -o $(HTML_DIR)/$(basename $(notdir $(file))).html;)

.PHONY=build
13 changes: 13 additions & 0 deletions internal/mail/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Email templates

These email templates are generated using [MJML](https://mjml.io/). It may be
helpful to add an [IDE extension](https://documentation.mjml.io/#development) to
aid in development.

## Build templates

All templates in the `mjml` directory can be built by running the following command:

```
make build
```

0 comments on commit 24022e8

Please sign in to comment.