Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
TranslateSandboxEmailJob.php
1<?php
2
3use MediaWiki\MediaWikiServices;
4
5class TranslateSandboxEmailJob extends Job {
6
11 public static function newJob( array $params ) {
12 return new self( Title::newMainPage(), $params );
13 }
14
19 public function __construct( $title, $params ) {
20 parent::__construct( __CLASS__, $title, $params );
21 }
22
23 public function run() {
24 $services = MediaWikiServices::getInstance();
25 $status = $services
26 ->getEmailer()
27 ->send(
28 [ $this->params['to'] ],
29 $this->params['from'],
30 $this->params['subj'],
31 $this->params['body'],
32 null,
33 [ 'replyTo' => $this->params['replyto'] ]
34 );
35
36 return $status->isOK();
37 }
38}