Page MenuHomePhabricator

[GSoC] Minimum Viable Product (MVP) for Implementing HTML E-Mail support for MediaWiki
Open, Needs TriagePublic

Description

Features to be implemented in the MVP, for T130490

  • Implement very basic plain text to HTML conversions:
    • Use nl2br to convert newlines to <br/> tags
    • Include links in <a> tags. Account for links being in brackets (()), in quotes (‘’ or “”) and any other format that we find people tend to mention links in plain text.
  • In order to reduce redundancy and allowing extensions to reuse/alter their existing HTML email support, a new global $wgCoreHTMLEmail could be added to allow Wiki Administrators to send plain text emails if they want to (send plain text email if $wgCoreHTMLEmail is set to false, and send multipart email if it is true) , besides $wgAllowHTMLEmail, which decides whether the Wiki allows anybody (core or extension) to send an HTML Email. To explain the different cases more clearly,
    • if ($wgAllowHTMLEmail == false) only plain text emails go
    • if ($wgAllowHTMLEmail == true and $wgCoreHTMLEmail == false) Anybody *except core* can send an HTML email.
    • if ($wgAllowHTMLEmail == true and $wgCoreHTMLEmail == true) Everybody can and core *will* send an HTML email.
  • The server will send emails to the client depending upon user preferences:
    • The user will be given a “Receive plain text email only” option in Special:Preferences. When this is ticked, the server will send only plain text emails to that specific user.
    • When the above option is unticked, the server will send a multipart email (both HTML and plain text) when both $wgAllowHTMLEmail and $wgCoreHTMLEmail are set to true.
  • Translation: When generating a key to be passed to wfMessage(), it will be assumed that if the key does not end with -html, the text is wikitext/plaintext. If the caller of the function wishes to include html in the text, the key must be appended by -html.

Event Timeline

Restricted Application added subscribers: Zppix, Aklapper. · View Herald TranscriptMay 17 2016, 9:14 AM

Change 291922 had a related patch set uploaded (by Galorefitz):
EmailNotification.php: Method for basic html transformations to emails

https://gerrit.wikimedia.org/r/291922

Change 293116 had a related patch set uploaded (by Galorefitz):
Get transformContenttoHTML() to accept i18n key

https://gerrit.wikimedia.org/r/293116

Change 294682 had a related patch set uploaded (by Galorefitz):
User preference for receiving plaintext emails only

https://gerrit.wikimedia.org/r/294682

Change 295131 had a related patch set uploaded (by Galorefitz):
Implement User Preference for Batch Emails

https://gerrit.wikimedia.org/r/295131

Change 303238 had a related patch set uploaded (by Galorefitz):
Implement multipart Email with basic HTML transformations

https://gerrit.wikimedia.org/r/303238

Change 305430 had a related patch set uploaded (by Galorefitz):
Added HTML Email template

https://gerrit.wikimedia.org/r/305430