Skip to content

Commit

Permalink
Email: Use MJML email templates (grafana#57751)
Browse files Browse the repository at this point in the history
Co-authored-by: Santiago <[email protected]>
  • Loading branch information
gillesdemey and santihernandezc authored Nov 17, 2022
1 parent 18738cf commit ea27eca
Show file tree
Hide file tree
Showing 56 changed files with 3,072 additions and 3,552 deletions.
16 changes: 16 additions & 0 deletions devenv/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This folder contains useful scripts and configuration so you can:

- Configure data sources in Grafana for development.
- Configure dashboards for development and test scenarios.
- Set up an SMTP Server + Web Interface for viewing and testing emails.
- Create docker-compose file with databases and fake data.

## Install Docker
Expand Down Expand Up @@ -58,6 +59,21 @@ Jaeger block runs both Jaeger and Loki container. Loki container sends traces to
| 1.0 | graphite1 | 8280 | 2203 | 2203 |
| 0.9 | graphite09 | 8380 | 2303 | 2303 |

#### MailDev

MailDev block runs an SMTP server and a web UI to test and view emails. This is useful for testing your email notifications locally.

Make sure you configure your .ini file with the following settings:

```ini
[smtp]
enabled = true
skip_verify = true
host = "localhost:1025"
```

You can access the web UI at http://localhost:12080/#/

## Debugging setup in VS Code
An example of launch.json is provided in `devenv/vscode/launch.json`. It basically does what Makefile and .bra.toml do. The 'program' field is set to the folder name so VS Code loads all *.go files in it instead of just main.go.

Expand Down
14 changes: 14 additions & 0 deletions emails/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
build: build-html build-txt

build-html:
npx mjml \
--config.beautify true \
--config.minify false \
--config.validationLevel=strict \
--config.keepComments=false \
./templates/*.mjml --output ../public/emails/

build-txt:
npx grunt

.PHONY: build build-html build-txt
Loading

0 comments on commit ea27eca

Please sign in to comment.