Email templates are repeated
Categories
(developer.mozilla.org Graveyard :: Code Cleanup, defect, P3)
Tracking
(Not tracked)
People
(Reporter: peterbe, Unassigned)
Details
(Keywords: in-triage, Whiteboard: [specification][type:bug][points=2])
For example, when we send the welcome email [0], inside that function we prepare one text/plain string [1] and one text/html string [2] and send it as a multi-part email.
The problem is that we might accidentally stray and fail to update one or the other. It's only a matter of time till we accidentally edit one but fail to update the other.
It's also more (l10n) strings to worry about and maintain and possibly go wrong.
[0] https://github.com/mozilla/kuma/blob/a52efbe0510e36ab5dd06806b6d623ad82644924/kuma/users/tasks.py#L49-L52
[1] https://github.com/mozilla/kuma/blob/master/kuma/users/jinja2/users/email/welcome/plain.ltxt
[2] https://github.com/mozilla/kuma/blob/master/kuma/users/jinja2/users/email/welcome/html.ltxt
Reporter | ||
Comment 1•6 years ago
|
||
I suspect there are many email clients in 2019 that don't support HTML emails. Granted, the CSS and HTML features are flaky [0] and messy but our current HTML template keeps it simple anyway. It used to be that people (especially very technically savy) would force their email client to use the plain text version if there was a choice which is often smart if the HTML is obnoxious.
My preference is to ONLY generate the HTML string and as a good measure, convert that HTML to plain text in runtime just to cover your bases. This way you still send plaintext and html but only have to author (and maintain!) one format.
See https://www.peterbe.com/plog/html2plaintext for an example solution.
[0] https://templates.mailchimp.com/resources/email-client-css-support/
Updated•6 years ago
|
Comment 2•5 years ago
|
||
Updated•5 years ago
|
Description
•