-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
60104fb
feat(core): Switch to MJML for email templates
netroy 78f1f2f
fix button line-height
netroy c4e021d
change button text to sentence case
netroy 5499dcc
rename template files to kebab-case
netroy b3c9362
Update user-invited.mjml
netroy bf2333e
Update password-reset-requested.mjml
netroy 5d24a01
use the destructured base payload first
netroy 062c67a
Merge remote-tracking branch 'origin/master' into PAY-1807-mjml-templ…
netroy 7c81fb2
add n8n logo at the bottom of every email
netroy c4a9376
use correct n8n colors
netroy 928db25
use the correct font-stack
netroy afee928
inline the logo
netroy 6e2089a
add a background color to "fix" dark mode contrast issues
netroy f58a2ad
add a notice to the password-reset email
netroy 9da8536
fix config test
netroy b3114bf
Merge remote-tracking branch 'origin/master' into PAY-1807-mjml-templ…
netroy e4f415b
add a space before punctuation to avoid it messing up the domain rend…
netroy 262eb47
use a png image instead for the logo
netroy 5b30cc8
highlight domain and notes better in email templates
netroy 4425309
use an inline image instead of a data-uri for logo
netroy bbb2bc2
Merge remote-tracking branch 'origin/master' into PAY-1807-mjml-templ…
netroy a8c6d98
Merge remote-tracking branch 'origin/master' into PAY-1807-mjml-templ…
netroy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
packages/cli/src/user-management/email/templates/_common.mjml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<mj-head> | ||
<mj-attributes> | ||
<mj-all font-family="Open Sans, sans-serif"></mj-all> | ||
<mj-body background-color="#fbfcfe"></mj-body> | ||
<mj-text | ||
font-weight="400" | ||
font-size="16px" | ||
color="#444444" | ||
line-height="24px" | ||
padding="10px 0 0 0" | ||
align="center" | ||
></mj-text> | ||
<mj-button | ||
background-color="#ff6f5c" | ||
color="#ffffff" | ||
font-size="18px" | ||
font-weight="600" | ||
align="center" | ||
padding-top="20px" | ||
line-height="24px" | ||
border-radius="4px" | ||
></mj-button> | ||
<mj-section padding="20px 0px"></mj-section> | ||
</mj-attributes> | ||
</mj-head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<mj-section> | ||
<mj-column> | ||
<mj-image src="cid:n8n-logo" height="40px" width="70px" /> | ||
</mj-column> | ||
</mj-section> |
18 changes: 18 additions & 0 deletions
18
packages/cli/src/user-management/email/templates/credentials-shared.mjml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<mjml> | ||
<mj-include path="./_common.mjml" /> | ||
<mj-body> | ||
<mj-section> | ||
<mj-column> | ||
<mj-text font-size="24px" color="#ff6f5c">A credential has been shared with you</mj-text> | ||
</mj-column> | ||
</mj-section> | ||
<mj-section background-color="#FFFFFF" border="1px solid #ddd"> | ||
<mj-column> | ||
<mj-text><b>"{{ credentialsName }}"</b> credential has been shared with you.</mj-text> | ||
<mj-text>To access it, please click the button below.</mj-text> | ||
<mj-button href="{{credentialsListUrl}}">Open credential</mj-button> | ||
</mj-column> | ||
</mj-section> | ||
<mj-include path="./_logo.mjml" /> | ||
</mj-body> | ||
</mjml> |
4 changes: 0 additions & 4 deletions
4
packages/cli/src/user-management/email/templates/credentialsShared.html
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
packages/cli/src/user-management/email/templates/instanceSetup.html
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions
31
packages/cli/src/user-management/email/templates/password-reset-requested.mjml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<mjml> | ||
<mj-include path="./_common.mjml" /> | ||
<mj-body> | ||
<mj-section> | ||
<mj-column> | ||
<mj-text font-size="24px" color="#ff6f5c">Reset your n8n password</mj-text> | ||
</mj-column> | ||
</mj-section> | ||
<mj-section background-color="#FFFFFF" border="1px solid #ddd"> | ||
<mj-column> | ||
<mj-text font-size="20px">Hi {{firstName}},</mj-text> | ||
<mj-text>Somebody asked to reset your password on n8n at <b>{{domain}}</b> .</mj-text> | ||
<mj-text> Click the following link to choose a new password. </mj-text> | ||
<mj-button href="{{passwordResetUrl}}">Set a new password</mj-button> | ||
|
||
<mj-text font-size="14px"> | ||
The link is only valid for 20 minutes since this email was sent. | ||
</mj-text> | ||
</mj-column> | ||
</mj-section> | ||
<mj-section> | ||
<mj-column> | ||
<mj-text font-size="12px" color="#777"> | ||
If you did not request this email, you can safely ignore this. <br /> | ||
Your password will not be changed. | ||
</mj-text> | ||
</mj-column> | ||
</mj-section> | ||
<mj-include path="./_logo.mjml" /> | ||
</mj-body> | ||
</mjml> |
5 changes: 0 additions & 5 deletions
5
packages/cli/src/user-management/email/templates/passwordReset.html
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
packages/cli/src/user-management/email/templates/user-invited.mjml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<mjml> | ||
<mj-include path="./_common.mjml" /> | ||
<mj-body> | ||
<mj-section> | ||
<mj-column> | ||
<mj-text font-size="24px" color="#ff6f5c">Welcome to n8n! 🎉</mj-text> | ||
</mj-column> | ||
</mj-section> | ||
<mj-section background-color="#FFFFFF" border="1px solid #ddd"> | ||
<mj-column> | ||
<mj-text>You have been invited to join n8n at <b>{{domain}}</b> .</mj-text> | ||
<mj-text>To accept, please click the button below.</mj-text> | ||
<mj-button href="{{inviteAcceptUrl}}">Set up your n8n account</mj-button> | ||
</mj-column> | ||
</mj-section> | ||
<mj-include path="./_logo.mjml" /> | ||
netroy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</mj-body> | ||
</mjml> |
18 changes: 18 additions & 0 deletions
18
packages/cli/src/user-management/email/templates/workflow-shared.mjml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<mjml> | ||
<mj-include path="./_common.mjml" /> | ||
<mj-body> | ||
<mj-section> | ||
<mj-column> | ||
<mj-text font-size="24px" color="#ff6f5c">A workflow has been shared with you</mj-text> | ||
</mj-column> | ||
</mj-section> | ||
<mj-section background-color="#FFFFFF" border="1px solid #ddd"> | ||
<mj-column> | ||
<mj-text><b>"{{ workflowName }}"</b> workflow has been shared with you.</mj-text> | ||
<mj-text>To access it, please click the button below.</mj-text> | ||
<mj-button href="{{workflowUrl}}">Open Workflow</mj-button> | ||
</mj-column> | ||
</mj-section> | ||
<mj-include path="./_logo.mjml" /> | ||
</mj-body> | ||
</mjml> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Looks like the higher contrast for dark mode didn't work?
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.