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
Email HTML templates #1673
Email HTML templates #1673
Conversation
We specifically wanted to get rid of |
f0f9b3f
to
d6b177b
Compare
Codecov Report
@@ Coverage Diff @@
## master #1673 +/- ##
==========================================
+ Coverage 83% 83.08% +0.08%
==========================================
Files 142 142
Lines 6071 6077 +6
Branches 660 661 +1
==========================================
+ Hits 5039 5049 +10
+ Misses 861 858 -3
+ Partials 171 170 -1
Continue to review full report at Codecov.
|
957023f
to
4a99296
Compare
We've discussed two potential solutions in the past. Both would mean keeping a "source" template and a "compiled" template with its styles inlined: |
@patrys There is some wrapper for MJML in Django, we'll check if we could use it. |
@elwoodxblues I was thinking about putting compiled templates (including Django variable placeholders) where Django can find them, not running another server. |
6a7379d
to
7c71694
Compare
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.
Code looks good! I'd love to see a screenshot.
<mj-include path="../../shared/header" /> | ||
<mj-section> | ||
<mj-column> | ||
<mj-text font-size="16px"> |
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.
Seems like extra space left after attr's deletion? This repeats everywhere that <mj-text font-size="16px">
was copied to.
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.
You're right, I'll fix it.
</mj-text> | ||
<mj-text> | ||
{% blocktrans context "Promote customer to staff member confirmation e-mail text" %} | ||
You're receiving this e-mail because you have been promoted to staff member at {{ domain }}. |
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.
This template (as well as it's plain text version) could also contain a link to the dashboard, so that receiver of this email could quickly log in there.
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.
Ok, I'll add it.
I think we could compile all templates to a single directory, similarly to how webpack compiles the assets to |
I think it's worth considering passing the |
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.
LGTM
3c6cf71
to
bee6a90
Compare
I want to merge this change because it adds compiled HTML templates for e-mails and improves its' content. It introduces MJML as a markup language used for structuring e-mails.
Closes #1662
Pull Request Checklist
pycodestyle
,pydocstyle
,pylint
.eslint
.[Edit]
Below are some compiled MJML email templates rendered by Django.
Order confirmation e-mail.
Staff member password set up e-mail.