Page MenuHomePhabricator

Replace static calls related to UserMail with calling respective methods of EmailSender service
Open, HighPublic8 Estimated Story Points

Description

Motivation

At the moment in order to send emails, static class UserMail provides a bundle of static functions and helpers. This makes testing impossible.

class Mailer service was introduced as part of T247229 but it just calls static method and didn't change calls

Expected result.

  • UserMail class and all its methods should be marked as deprecated
  • Calls to UserMail's methods should be changed to retrospective methods of Mailer
  • Mailer should be injected through DI where it's possible or MediaWikiServices::instance() where DI is not introduced.

Event Timeline

daniel renamed this task from Replace static calls related to UserMail with calling retrospective methods of EmailSender service to Replace static calls related to UserMail with calling respective methods of EmailSender service.Mar 27 2020, 10:39 AM
Helga_sf set the point value for this task to 8.Apr 30 2020, 2:55 PM

Change 596088 had a related patch set uploaded (by Art-Baltai; owner: Art-Baltai):
[mediawiki/core@master] Use IEmailer service instead of UserMailer

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

Change 596089 had a related patch set uploaded (by Art-Baltai; owner: Art-Baltai):
[mediawiki/extensions/Translate@master] Use IEmailer service instead of UserMailer

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

Change 596090 had a related patch set uploaded (by Art-Baltai; owner: Art-Baltai):
[mediawiki/extensions/LiquidThreads@master] Use IEmailer service instead of UserMailer

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

Change 597404 had a related patch set uploaded (by Art-Baltai; owner: Art-Baltai):
[mediawiki/core@master] Implement EmailNotification as service

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

Change 596089 merged by jenkins-bot:
[mediawiki/extensions/Translate@master] Use IEmailer service instead of UserMailer if available

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

Change 596090 merged by jenkins-bot:
[mediawiki/extensions/LiquidThreads@master] Use IEmailer service instead of UserMailer

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

Change 596088 merged by jenkins-bot:

[mediawiki/core@master] Use Emailer class instead of UserMailer

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

Aklapper added a subscriber: roman-stolar.

@roman-stolar: Removing task assignee as this open task has been assigned for more than two years - See the email sent to task assignee on October 11th.
Please assign this task to yourself again if you still realistically [plan to] work on this task - it would be welcome! :)
If this task has been resolved in the meantime, or should not be worked on by anybody ("declined"), please update its task status via "Add Action… 🡒 Change Status".
Also see https://www.mediawiki.org/wiki/Bug_management/Assignee_cleanup for tips how to best manage your individual work in Phabricator. Thanks!