Closed Bug 1544433 Opened 6 years ago Closed 5 years ago

Email templates are repeated

Categories

(developer.mozilla.org Graveyard :: Code Cleanup, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED WONTFIX

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

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/

Keywords: in-triage
Priority: -- → P3
Whiteboard: [specification][type:bug][points=2]
MDN Web Docs' bug reporting has now moved to GitHub. From now on, please file content bugs at https://github.com/mdn/sprints/issues/ and platform bugs at https://github.com/mdn/kuma/issues/.
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → WONTFIX
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.