mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-12 09:26:05 +00:00
9d08c96fad
Mainly because I was annoyed at m<tab>o<tab>d<tab>u<tab> to reach modules/. Change-Id: Ib149cb2e2612ccddd0503f9d0c5d05b554860a00
27 lines
826 B
PHP
27 lines
826 B
PHP
<?php
|
|
|
|
class MWEchoNotificationEmailBundleJob extends Job {
|
|
function __construct( $title, $params ) {
|
|
parent::__construct( __CLASS__, $title, $params );
|
|
// If there is already a job with the same params, this job will be ignored
|
|
// for example, if there is a page link bundle notification job for article A
|
|
// created by user B, any subsequent jobs with the same data will be ignored
|
|
$this->removeDuplicates = true;
|
|
}
|
|
|
|
function run() {
|
|
$bundle = MWEchoEmailBundler::newFromUserHash(
|
|
User::newFromId( $this->params['user_id'] ),
|
|
$this->params['bundle_hash']
|
|
);
|
|
|
|
if ( $bundle ) {
|
|
$bundle->processBundleEmail();
|
|
} else {
|
|
throw new MWException( 'Fail to create bundle object for: user_id: ' . $this->params['user_id'] . ', bundle_hash: ' . $this->params['bundle_hash'] );
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|