Skip to content

Commit 07e7b3f

Browse files
committed
🏷️(mail) adapt to mjml v5
We upgraded to mjml v5, which has some breaking changes. By default the ubuntu font was loaded, with google fonts, that is not GDPR compliant. We switched to Inter, and uses fonts.bunny.net to load the font, which is GDPR compliant.
1 parent aa71cfd commit 07e7b3f

3 files changed

Lines changed: 16 additions & 14 deletions

File tree

src/mail/bin/mjml-to-html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ DOCS_DIR_MAILS="${DOCS_DIR_MAILS:-../backend/core/templates/mail}/html/"
66
if [ ! -d "${DOCS_DIR_MAILS}" ]; then
77
mkdir -p "${DOCS_DIR_MAILS}";
88
fi
9-
mjml mjml/*.mjml -o "${DOCS_DIR_MAILS}";
9+
mjml mjml/*.mjml -o "${DOCS_DIR_MAILS}" --config.allowIncludes true;

src/mail/mjml/partial/header.mjml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
<mj-head>
22
<mj-title>{{ title }}</mj-title>
3-
<mj-preview>
4-
<!--
5-
We load django tags here, in this way there are put within the body in html output
6-
so the html-to-text command includes it within its output
7-
-->
8-
{% load i18n static extra_tags %}
9-
{{ title }}
10-
</mj-preview>
3+
<mj-preview>{{ title }}</mj-preview>
4+
<mj-font name="Inter" href="https://fonts.bunny.net/css?family=inter:300,400,500,700" />
115
<mj-attributes>
126
<mj-all
13-
font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Cantarell, 'Helvetica Neue', sans-serif"
7+
font-family="Inter, sans-serif"
148
font-size="16px"
159
line-height="normal"
1610
color="#3A3A3A"
1711
/>
12+
<mj-text font-family="Inter, sans-serif" />
13+
<mj-button font-family="Inter, sans-serif" />
1814
</mj-attributes>
1915
<mj-style>
2016
/* Reset */

src/mail/mjml/template.mjml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
<mj-include path="./partial/header.mjml" />
33

44
<mj-body mj-class="bg--blue-100">
5+
<!--
6+
We load django tags here so they appear in the body of the HTML output.
7+
This ensures html-to-text also includes them in the plain text template.
8+
-->
9+
<mj-raw>{% load i18n static extra_tags %}</mj-raw>
510
<mj-wrapper css-class="wrapper" padding="5px 25px 0px 25px">
611
<mj-section css-class="wrapper-logo">
712
<mj-column>
@@ -16,11 +21,11 @@
1621
</mj-section>
1722
<mj-section mj-class="bg--white-100" padding="0px 20px 60px 20px">
1823
<mj-column>
19-
<mj-text align="center">
24+
<mj-text align="center" font-family="Inter, sans-serif">
2025
<h1>{{title|capfirst}}</h1>
2126
</mj-text>
2227
<!-- Main Message -->
23-
<mj-text>
28+
<mj-text font-family="Inter, sans-serif">
2429
{{message|capfirst}}
2530
<a href="{{link}}">{{link_label}}</a>
2631
</mj-text>
@@ -29,6 +34,7 @@
2934
background-color="#000091"
3035
color="white"
3136
padding-bottom="30px"
37+
font-family="Inter, sans-serif"
3238
>
3339
{{button_label}}
3440
</mj-button>
@@ -39,13 +45,13 @@
3945
width="30%"
4046
align="center"
4147
/>
42-
<mj-text>
48+
<mj-text font-family="Inter, sans-serif">
4349
{% blocktrans %}
4450
Docs, your new essential tool for organizing, sharing and collaborating on your documents as a team.
4551
{% endblocktrans %}
4652
</mj-text>
4753
<!-- Signature -->
48-
<mj-text>
54+
<mj-text font-family="Inter, sans-serif">
4955
<p>
5056
{% blocktrans %}
5157
Brought to you by {{brandname}}

0 commit comments

Comments
 (0)