-
Notifications
You must be signed in to change notification settings - Fork 8.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(core): Switch to MJML for email templates #10518
Conversation
ca6104a
to
60104fb
Compare
packages/cli/src/user-management/email/templates/passwordReset.mjml
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for tackling this!
- Button text doesn't look fully vertically centered.
- I think we've been moving to sentence case rather than title case throughout the app, esp. for button text.
- For dark mode we might want to add more contrast to the title color and the button text color.
packages/cli/src/user-management/email/templates/credentialsShared.mjml
Outdated
Show resolved
Hide resolved
packages/cli/src/user-management/email/templates/credentialsShared.mjml
Outdated
Show resolved
Hide resolved
<mj-text>You have been invited to join n8n ({{domain}}).</mj-text> | ||
<mj-text>To accept, please click the button below. </mj-text> | ||
<mj-button href="{{inviteAcceptUrl}}"> Set Up Your Account </mj-button> | ||
</mj-column> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra sentence/link somewhere explaining to the invitee what even is n8n?
packages/cli/src/user-management/email/templates/passwordReset.mjml
Outdated
Show resolved
Hide resolved
packages/cli/src/user-management/email/templates/workflowShared.mjml
Outdated
Show resolved
Hide resolved
<mj-text font-size="24px" color="#ff6d5a"> A workflow has been shared with you </mj-text> | ||
</mj-column> | ||
</mj-section> | ||
<mj-section background-color="#FFFFFF" border="1px solid #ddd"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not familiar with MJML, maybe there's a way to extract common styles to _common
and use CSS classes instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while it is possible, I've always struggled it do that in the past. Also, since these are emails, all those styles are likely to be inlined anyways.
I'd like to improve this whole setup, but perhaps in another PR.
packages/cli/src/user-management/email/user-management-mailer.ts
Outdated
Show resolved
Hide resolved
packages/cli/src/user-management/email/templates/user-invited.mjml
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure how to fix this considering that this dark-mode is likely being done in the client. If I download the html email, and open it the browser, it renders fine in light mode.
packages/cli/src/user-management/email/templates/password-reset-requested.mjml
Outdated
Show resolved
Hide resolved
packages/cli/src/user-management/email/templates/workflow-shared.mjml
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we make exceptions for field name casing based on filename casing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine wither way. Do you prefer one way or the other?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer we stay consistent with camelCase, but not a blocker, can be addressed later.
packages/cli/src/user-management/email/templates/credentials-shared.mjml
Outdated
Show resolved
Hide resolved
LGTM, let's fix the conflicts and bring this in :) |
n8n Run #6652
Run Properties:
|
Project |
n8n
|
Branch Review |
PAY-1807-mjml-templates
|
Run status |
Passed #6652
|
Run duration | 04m 59s |
Commit |
a8c6d98cc0: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 netroy 🗃️ e2e/*
|
Committer | कारतोफ्फेलस्क्रिप्ट™ |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
0
|
Pending |
0
|
Skipped |
0
|
Passing |
421
|
View all changes introduced in this branch ↗︎ |
✅ All Cypress E2E specs passed |
* master: (24 commits) feat(core): Switch to MJML for email templates (#10518) fix(Gmail Trigger Node): Don't return date instances, but date strings instead (#10582) fix(core): Deduplicate sentry events using error stacktraces instead (no-changelog) (#10590) feat(editor): Implement new app layout (#10548) refactor(core): Standardize filename casing for services and Public API (no-changelog) (#10579) 🚀 Release 1.57.0 (#10587) fix(editor): Add tooltips to workflow history button (#10570) ci: Fix provenance generation during NPM publish (no-changelog) (#10586) feat(core): Expose queue metrics for Prometheus (#10559) refactor(core): Map out pubsub messages (no-changelog) (#10566) fix: Fix scenario prefix not being passed (no-changelog) (#10575) refactor(core): Convert `verbose` to `debug` logs (#10574) refactor(core): Use `@/databases/` instead of `@db/` (no-changelog) (#10573) ci: Fix destroy benchmark env workflow (no-changelog) (#10572) feat: Add benchmarking of pooled sqlite (no-changelog) (#10550) refactor(editor): User journey link to n8n.io (#10331) fix(Wait Node): Prevent waiting until invalid date (#10523) refactor(core): Standardize filename casing for controllers and databases (no-changelog) (#10564) refactor(core): Allow custom types on getCredentials (no-changelog) (#10567) fix(editor): Scale output item selector input width with value (#10555) ... # Conflicts: # packages/editor-ui/src/stores/assistant.store.ts
Got released with |
Summary
Our current email templates lack any style, formatting, semantic markup, etc. This is likely contributing a bit to our emails being marked as spam.
This PR migrates all our emails over to MJML to (hopefully) improve how our emails our perceived.
User Invitation email
Password reset request email
Workflow sharing email
Credential sharing email
Related Linear tickets, Github issues, and Community forum posts
https://linear.app/n8n/issue/PAY-1807
https://linear.app/n8n/issue/HELP-579
Review / Merge checklist