2021-02-25 23:22:26 -05:00
|
|
|
# Directory containing mjml templates
|
|
|
|
|
OUTPUT_DIR=.
|
|
|
|
|
MJML=mjml
|
|
|
|
|
|
2021-10-07 03:37:38 -04:00
|
|
|
## Also update the circleCI file if you update this.
|
2021-02-25 23:22:26 -05:00
|
|
|
check-prereq: ## check if mjml is installed
|
|
|
|
|
@if ! [ -x "$$(command -v mjml)" ]; then \
|
|
|
|
|
echo "mjml is not installed. Installing mjml"; \
|
2021-10-07 03:37:38 -04:00
|
|
|
npm install -g mjml@4.9.0; \
|
2021-02-25 23:22:26 -05:00
|
|
|
fi;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build: check-prereq ## Compile all mjml email templates
|
|
|
|
|
@for f in $(shell ls *.mjml); \
|
|
|
|
|
do \
|
|
|
|
|
echo "{{define \"$${f%.*}\"}}\n" > $(OUTPUT_DIR)/$${f%.*}.html; \
|
|
|
|
|
$(MJML) $${f} -s >> $(OUTPUT_DIR)/$${f%.*}.html; \
|
|
|
|
|
echo "\n{{end}}" >> $(OUTPUT_DIR)/$${f%.*}.html; \
|
|
|
|
|
done
|