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

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 11 2020, 9:02 AM
Peter.ovchyn removed Peter.ovchyn as the assignee of this task.Mar 23 2020, 11:42 AM
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

Helga_sf triaged this task as High priority.May 25 2020, 11:47 AM

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

Helga_sf removed a subscriber: Art-Baltai.