UserMailer bigtime refactor. Please test.
[lhc/web/wiklou.git] / includes / EnotifNotifyJob.php
1 <?php
2
3 /**
4 * Job for email notification mails
5 *
6 * @ingroup JobQueue
7 */
8 class EnotifNotifyJob extends Job {
9
10 function __construct( $title, $params, $id = 0 ) {
11 parent::__construct( 'enotifNotify', $title, $params, $id );
12 }
13
14 function run() {
15 // Get the user from ID (rename safe). Anons are 0, so defer to name.
16 if( isset($this->params['editorID']) && $this->params['editorID'] ) {
17 $editor = User::newFromId( $this->params['editorID'] );
18 // B/C, only the name might be given.
19 } else {
20 $editor = User::newFromName( $this->params['editor'], false );
21 }
22 PageChangeNotification::actuallyNotifyOnPageChange(
23 $editor,
24 $this->title,
25 $this->params['timestamp'],
26 $this->params['summary'],
27 $this->params['minorEdit'],
28 $this->params['oldid']
29 );
30 return true;
31 }
32
33 }