-
Notifications
You must be signed in to change notification settings - Fork 684
Implement HTML emails #12583
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
base: main
Are you sure you want to change the base?
Implement HTML emails #12583
Conversation
a8c7ae1 to
27e3973
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.
This seems very basic, and could create problems with some anti-spam systems which expect a proper HTML document. If I remember correctly even tools like https://www.mail-tester.com pointed this aspect out.
Another basic test I found interesting in the past was to send emails to Fastmail, download the .eml for the message and look for the X-Spam-hits header. This is what it will looks like for a crates.io email from a few weeks ago:
X-Spam-hits: BAYES_40 -0.001, DCC_CHECK 1.1, ME_SENDERREP_HAM -2,
RCVD_IN_DNSWL_NONE -0.0001, RCVD_IN_MSPIKE_H5 0.001,
RCVD_IN_MSPIKE_WL 0.001, SPF_HELO_NONE 0.001, SPF_PASS -0.001,
LANGUAGES en, BAYES_USED user, SA_VERSION 4.0.1
You can then search for the meaning of rules with a negative score or have an LLM explain it to you.
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 seems very basic, and could create problems with some anti-spam systems which expect a proper HTML document.
interesting. I looked at some of the emails GitHub was sending and they do not seem to use a full HTML structure either, which is why I implemented it this way 🤔
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.
If I remember correctly even tools like https://www.mail-tester.com pointed this aspect out.
I just ran a quick test and that website appears to be happy with the current state (see https://www.mail-tester.com/test-d5sh981cg).
I used https://htmltest.email/ to send the email to https://www.mail-tester.com, but I assume that shouldn't matter for this specific check?
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.
Interesting. I guess what I may have seen in the past was a rule in X-Spam-hits penalizing emails with incomplete or broken HTML.
Co-authored-by: Paolo Barbolini <[email protected]>
One of the original goals of moving to a template system for our emails was to support HTML emails. This PR finally implements them.
Each email type now has an additional
body.html.j2template that is used to generate the HTML content for the email. If theHTML_EMAILS_ENABLEDenvironment variable is set totruethen the generated emails will contain multipart content with plaintext and HTML content. Once we have verified that this is not causing any issues in production this feature flag can be removed again.Note that the email templates have intentionally been kept quite basic for now. We can start to extend them once we verified that everything works as intended.
/cc @paolobarbolini