Skip to content

Commit ea27eca

Browse files
Email: Use MJML email templates (grafana#57751)
Co-authored-by: Santiago <santiagohernandez.1997@gmail.com>
1 parent 18738cf commit ea27eca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+3072
-3552
lines changed

devenv/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ This folder contains useful scripts and configuration so you can:
44

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

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

62+
#### MailDev
63+
64+
MailDev block runs an SMTP server and a web UI to test and view emails. This is useful for testing your email notifications locally.
65+
66+
Make sure you configure your .ini file with the following settings:
67+
68+
```ini
69+
[smtp]
70+
enabled = true
71+
skip_verify = true
72+
host = "localhost:1025"
73+
```
74+
75+
You can access the web UI at http://localhost:12080/#/
76+
6177
## Debugging setup in VS Code
6278
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.
6379

emails/Makefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
build: build-html build-txt
2+
3+
build-html:
4+
npx mjml \
5+
--config.beautify true \
6+
--config.minify false \
7+
--config.validationLevel=strict \
8+
--config.keepComments=false \
9+
./templates/*.mjml --output ../public/emails/
10+
11+
build-txt:
12+
npx grunt
13+
14+
.PHONY: build build-html build-txt

0 commit comments

Comments
 (0)