Skip to content

Commit 95be950

Browse files
committed
Resolve upgrade conflicts from v4 to v5 of MJML
1 parent 7605b87 commit 95be950

16 files changed

Lines changed: 24 additions & 518 deletions

File tree

src/actions/utils/email/__fixtures__/example.mjml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
<mj-text>
2020
{{ htmlMessage | safe }}
2121
</mj-text>
22-
<mj-include path="./partials/footer.mjml" />
22+
<mj-text font-size="14px" color="#666666" padding-top="16px">
23+
View the <a href="https://example.com/privacy">privacy policy</a>.
24+
</mj-text>
2325
</mj-column>
2426
</mj-section>
2527
</mj-body>

src/actions/utils/email/__fixtures__/partials/common-contact.mjml

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/actions/utils/email/__fixtures__/partials/footer-macro.mjml

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/actions/utils/email/__fixtures__/partials/footer.mjml

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/actions/utils/email/__fixtures__/with-common-data.mjml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
{% import "./partials/footer-macro.mjml" as footer %}
2-
31
<mjml>
42
<mj-body>
53
<mj-section>
64
<mj-column>
75
<mj-text>Hello, {{ name }}!</mj-text>
8-
{{ footer.renderFooter(common.company.websiteLabel, common.company.url) }}
9-
{% include "./partials/common-contact.mjml" %}
6+
<mj-text>
7+
Visit <a href="{{ common.company.url }}">{{ common.company.websiteLabel }}</a>.
8+
</mj-text>
9+
<mj-text>
10+
Contact {{ common.company.name }} at
11+
<a href="{{ common.company.emailHref }}">{{ common.company.email }}</a>.
12+
</mj-text>
1013
</mj-column>
1114
</mj-section>
1215
</mj-body>

src/actions/utils/email/__tests__/templateCompiler.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ describe('compileEmailTemplate', () => {
5454
expect(result.text).toContain('brief.pdf (2.4 MB)')
5555
})
5656

57-
it('renders nunjucks data, supports mj-include, and returns html and plain text', async () => {
57+
it('renders nunjucks data and returns html and plain text', async () => {
5858
const result = await compileEmailTemplate(exampleTemplate, {
5959
htmlMessage: '<strong>Urgent</strong> message body',
6060
items: ['Coffee Beans', 'Espresso Machine'],
@@ -74,7 +74,7 @@ describe('compileEmailTemplate', () => {
7474
expect(result.text).toContain('privacy policy')
7575
})
7676

77-
it('injects common contact data and resolves relative nunjucks imports', async () => {
77+
it('injects common contact data into inline fixture content', async () => {
7878
const result = await compileEmailTemplate(withCommonDataTemplate, {
7979
name: 'Alex',
8080
})

src/actions/utils/email/footer/index.mjml

Lines changed: 0 additions & 66 deletions
This file was deleted.

src/actions/utils/email/footer/partials/contact-info.mjml

Lines changed: 0 additions & 54 deletions
This file was deleted.

src/actions/utils/email/footer/partials/disclaimer.mjml

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/actions/utils/email/footer/partials/layout.mjml

Lines changed: 0 additions & 163 deletions
This file was deleted.

0 commit comments

Comments
 (0)