MediaWiki master
EmailNotification Class Reference

Find watchers and create notifications after a page is changed. More...

Public Member Functions

 actuallyNotifyOnPageChange (Authority $editor, $title, RecentChange $recentChange, array $watchers, $pageStatus='changed')
 Immediate version of notifyOnPageChange().
 
 getPageStatus ()
 Extensions that have hooks for UpdateUserMailerFormattedPageStatus (to provide additional pageStatus indicators) need a way to make sure that, when their hook is called in SendWatchlistemailNotification, they only handle notifications using their pageStatus indicator.
 
 notifyOnPageChange (RecentChange $recentChange)
 Send emails corresponding to the user $editor editing the page $title.
 

Protected Attributes

string $pageStatus = ''
 

Detailed Description

Find watchers and create notifications after a page is changed.

After an edit is published to RCFeed, RecentChange::save calls EmailNotification. Here we query the watchlist table (via WatchedItemStore) to find who is watching a given page, format the emails in question, and dispatch notifications to each of them via the JobQueue.

Visit the documentation pages under https://www.mediawiki.org/wiki/Help:Watching_pages

Todo
Use UserOptionsLookup and other services, consider converting this to a service
Since
1.11.0

Definition at line 53 of file EmailNotification.php.

Member Function Documentation

◆ actuallyNotifyOnPageChange()

EmailNotification::actuallyNotifyOnPageChange ( Authority $editor,
$title,
RecentChange $recentChange,
array $watchers,
$pageStatus = 'changed' )

Immediate version of notifyOnPageChange().

Send emails corresponding to the user $editor editing the page $title.

Note
Do not call directly. Use notifyOnPageChange so that wl_notificationtimestamp is updated.
Since
1.11.0
Parameters
Authority$editor
Title$title
RecentChange$recentChange
array$watchersArray of user IDs
string$pageStatus
Access: internal

Definition at line 170 of file EmailNotification.php.

References MediaWiki\RecentChanges\RecentChange\getAttribute(), MediaWiki\User\Options\UserOptionsLookup\getOption(), MediaWiki\Permissions\Authority\getUser(), MediaWiki\Permissions\Authority\isAllowed(), and NS_USER_TALK.

◆ getPageStatus()

EmailNotification::getPageStatus ( )

Extensions that have hooks for UpdateUserMailerFormattedPageStatus (to provide additional pageStatus indicators) need a way to make sure that, when their hook is called in SendWatchlistemailNotification, they only handle notifications using their pageStatus indicator.

Since
1.33
Returns
string

Definition at line 67 of file EmailNotification.php.

◆ notifyOnPageChange()

EmailNotification::notifyOnPageChange ( RecentChange $recentChange)

Send emails corresponding to the user $editor editing the page $title.

May be deferred via the job queue.

Since
1.11.0
1.35 returns a boolean indicating whether an email job was created.
1.44 This method takes just RecentChange $recentChange, instead of multiple parameters
Parameters
RecentChange$recentChange
Returns
bool Whether an email & notification job was created or not.

Definition at line 82 of file EmailNotification.php.

Member Data Documentation

◆ $pageStatus

string EmailNotification::$pageStatus = ''
protected

Definition at line 55 of file EmailNotification.php.


The documentation for this class was generated from the following file: