MediaWiki REL1_37
|
This module processes the email notifications when the current page is changed. More...
Public Member Functions | |
actuallyNotifyOnPageChange (Authority $editor, $title, $timestamp, $summary, $minorEdit, $oldid, $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 (Authority $editor, $title, $timestamp, $summary, $minorEdit, $oldid=false, $pageStatus='changed') | |
Send emails corresponding to the user $editor editing the page $title. | |
Protected Attributes | |
string | $body = '' |
bool | $composed_common = false |
User | $editor |
MailAddress null | $from |
MailAddress[] | $mailTargets = [] |
bool null | $minorEdit |
int null bool | $oldid |
string | $pageStatus = '' |
MailAddress null | $replyto |
string | $subject = '' |
string | $summary = '' |
string null | $timestamp |
Title | $title |
Private Member Functions | |
canSendUserTalkEmail (UserIdentity $editor, $title, $minorEdit) | |
compose (UserEmailContact $user, $source, MessageCache $messageCache) | |
Compose a mail to a given user and either queue it for sending, or send it now, depending on settings. | |
composeCommonMailtext (MessageCache $messageCache) | |
Generate the generic "this page has been changed" e-mail text. | |
sendImpersonal ( $addresses) | |
Same as sendPersonalised but does impersonal mail suitable for bulk mailing. | |
sendMails () | |
Send any queued mails. | |
sendPersonalised (UserEmailContact $watchingUser, $source) | |
Does the per-user customizations to a notification e-mail (name, timestamp in proper timezone, etc) and sends it out. | |
Private Attributes | |
const | ALL_CHANGES = 'all_changes' |
Notification because user is notified for all changes. | |
const | USER_TALK = 'user_talk' |
Notification is due to user's user talk being edited. | |
const | WATCHLIST = 'watchlist' |
Notification is due to a watchlisted page being edited. | |
This module processes the email notifications when the current page is changed.
It looks up the table watchlist to find out which users are watching that page.
The current implementation sends independent emails to each watching user for the following reason:
Suggested improvement to slack down the number of sent emails: We could think of sending out bulk mails (bcc:user1,user2...) for all these users having the same timeoffset in their preferences.
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
Definition at line 53 of file EmailNotification.php.
EmailNotification::actuallyNotifyOnPageChange | ( | Authority | $editor, |
$title, | |||
$timestamp, | |||
$summary, | |||
$minorEdit, | |||
$oldid, | |||
$watchers, | |||
$pageStatus = 'changed' |
|||
) |
Immediate version of notifyOnPageChange().
Send emails corresponding to the user $editor editing the page $title.
Authority | $editor | |
Title | $title | |
string | $timestamp | Edit timestamp |
string | $summary | Edit summary |
bool | $minorEdit | |
int | $oldid | Revision ID |
array | $watchers | Array of user IDs |
string | $pageStatus |
MWException |
Definition at line 218 of file EmailNotification.php.
References $title, MediaWiki\Permissions\Authority\getUser(), MediaWiki\Permissions\Authority\isAllowed(), UserArray\newFromIDs(), User\newFromName(), and NS_USER_TALK.
|
private |
UserIdentity | $editor | |
Title | $title | |
bool | $minorEdit |
Definition at line 309 of file EmailNotification.php.
References $title, MediaWiki\User\UserIdentity\getId(), User\newFromName(), NS_USER_TALK, and wfDebug().
|
private |
Compose a mail to a given user and either queue it for sending, or send it now, depending on settings.
Call sendMails() to send any mails that were queued.
UserEmailContact | $user | |
string | $source | |
MessageCache | $messageCache |
Definition at line 472 of file EmailNotification.php.
References $source.
|
private |
Generate the generic "this page has been changed" e-mail text.
MessageCache | $messageCache |
Definition at line 348 of file EmailNotification.php.
References $keys, SpecialPage\getSafeTitleFor(), MessageCache\transform(), wfExpandUrl(), and wfMessage().
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.
Definition at line 117 of file EmailNotification.php.
EmailNotification::notifyOnPageChange | ( | Authority | $editor, |
$title, | |||
$timestamp, | |||
$summary, | |||
$minorEdit, | |||
$oldid = false , |
|||
$pageStatus = 'changed' |
|||
) |
Send emails corresponding to the user $editor editing the page $title.
May be deferred via the job queue.
Authority | $editor | |
Title | $title | |
string | $timestamp | |
string | $summary | |
bool | $minorEdit | |
bool | $oldid | (default: false) |
string | $pageStatus | (default: 'changed') |
Definition at line 136 of file EmailNotification.php.
|
private |
Same as sendPersonalised but does impersonal mail suitable for bulk mailing.
Takes an array of MailAddress objects.
MailAddress[] | $addresses |
Definition at line 550 of file EmailNotification.php.
References wfMessage().
|
private |
Send any queued mails.
Definition at line 487 of file EmailNotification.php.
|
private |
Does the per-user customizations to a notification e-mail (name, timestamp in proper timezone, etc) and sends it out.
Returns Status if email was sent successfully or not (Status::newGood() or Status::newFatal() respectively).
UserEmailContact | $watchingUser | |
string | $source |
Definition at line 503 of file EmailNotification.php.
References $source, MediaWiki\Mail\UserEmailContact\getRealName(), and MediaWiki\Mail\UserEmailContact\getUser().
|
protected |
Definition at line 72 of file EmailNotification.php.
|
protected |
Definition at line 93 of file EmailNotification.php.
|
protected |
Definition at line 105 of file EmailNotification.php.
|
protected |
Definition at line 78 of file EmailNotification.php.
|
protected |
Definition at line 99 of file EmailNotification.php.
|
protected |
Definition at line 87 of file EmailNotification.php.
|
protected |
Definition at line 90 of file EmailNotification.php.
|
protected |
Definition at line 96 of file EmailNotification.php.
|
protected |
Definition at line 75 of file EmailNotification.php.
|
protected |
Definition at line 69 of file EmailNotification.php.
|
protected |
Definition at line 84 of file EmailNotification.php.
|
protected |
Definition at line 81 of file EmailNotification.php.
|
protected |
Definition at line 102 of file EmailNotification.php.
|
private |
Notification because user is notified for all changes.
Definition at line 66 of file EmailNotification.php.
|
private |
Notification is due to user's user talk being edited.
Definition at line 58 of file EmailNotification.php.
|
private |
Notification is due to a watchlisted page being edited.
Definition at line 62 of file EmailNotification.php.