MediaWiki  master
Go to the documentation of this file.
1 <?php
30 class EmaillingJob extends Job {
31  public function __construct( ?Title $title, array $params ) {
32  parent::__construct( 'sendMail', Title::newMainPage(), $params );
33  }
35  public function run() {
36  $status = UserMailer::send(
37  $this->params['to'],
38  $this->params['from'],
39  $this->params['subj'],
40  $this->params['body'],
41  [ 'replyTo' => $this->params['replyto'] ]
42  );
44  return $status->isOK();
45  }
46 }
Old job used for sending single notification emails; kept for backwards-compatibility.
__construct(?Title $title, array $params)
Run the job.
Class to both describe a background job and handle jobs.
Definition: Job.php:39
Title $title
Definition: Job.php:50
array $params
Array of job parameters.
Definition: Job.php:44
Represents a title within MediaWiki.
Definition: Title.php:49
static newMainPage(MessageLocalizer $localizer=null)
Create a new Title for the Main Page.
Definition: Title.php:700
static send( $to, $from, $subject, $body, $options=[])
This function will perform a direct (authenticated) login to a SMTP Server to use for mail relaying i...
Definition: UserMailer.php:120