Skip to content
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

Merged
merged 22 commits into from
Aug 28, 2024
Merged

Conversation

netroy
Copy link
Member

@netroy netroy commented Aug 22, 2024

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

invitation

Password reset request email

password reset request

Workflow sharing email

workflow sharing

Credential sharing email

credential sharing

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

  • PR title and summary are descriptive

@netroy netroy force-pushed the PAY-1807-mjml-templates branch from ca6104a to 60104fb Compare August 22, 2024 16:09
@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Aug 22, 2024
Copy link
Contributor

@ivov ivov left a 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!

  1. Button text doesn't look fully vertically centered.
  2. I think we've been moving to sentence case rather than title case throughout the app, esp. for button text.
  3. For dark mode we might want to add more contrast to the title color and the button text color.

<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>
Copy link
Contributor

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?

<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">
Copy link
Contributor

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?

Copy link
Member Author

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.

@netroy netroy requested a review from ivov August 23, 2024 11:21
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the higher contrast for dark mode didn't work?

Capture 2024-08-26 at 10 01 09@2x

Copy link
Member Author

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.

Copy link
Contributor

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?

Copy link
Member Author

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?

Copy link
Contributor

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.

@netroy netroy requested a review from ivov August 27, 2024 12:39
@ivov
Copy link
Contributor

ivov commented Aug 28, 2024

LGTM, let's fix the conflicts and bring this in :)

Copy link

cypress bot commented Aug 28, 2024

n8n    Run #6652

Run Properties:  status check passed Passed #6652  •  git commit a8c6d98cc0: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 netroy 🗃️ e2e/*
Project n8n
Branch Review PAY-1807-mjml-templates
Run status status check passed Passed #6652
Run duration 04m 59s
Commit git commit a8c6d98cc0: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 netroy 🗃️ e2e/*
Committer कारतोफ्फेलस्क्रिप्ट™
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 421
View all changes introduced in this branch ↗︎

Copy link
Contributor

✅ All Cypress E2E specs passed

@netroy netroy merged commit dbc10fe into master Aug 28, 2024
32 checks passed
@netroy netroy deleted the PAY-1807-mjml-templates branch August 28, 2024 15:15
MiloradFilipovic added a commit that referenced this pull request Aug 28, 2024
* 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
@github-actions github-actions bot mentioned this pull request Sep 5, 2024
@janober
Copy link
Member

janober commented Sep 5, 2024

Got released with n8n@1.58.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team Released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants