MediaWiki REL1_33
|
This module processes the email notifications when the current page is changed. More...
Public Member Functions | |
actuallyNotifyOnPageChange ( $editor, $title, $timestamp, $summary, $minorEdit, $oldid, $watchers, $pageStatus='changed') | |
Immediate version of notifyOnPageChange(). | |
compose ( $user, $source) | |
Compose a mail to a given user and either queue it for sending, or send it now, depending on settings. | |
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 ( $editor, $title, $timestamp, $summary, $minorEdit, $oldid=false, $pageStatus='changed') | |
Send emails corresponding to the user $editor editing the page $title. | |
sendImpersonal ( $addresses) | |
Same as sendPersonalised but does impersonal mail suitable for bulk mailing. | |
sendMails () | |
Send any queued mails. | |
sendPersonalised ( $watchingUser, $source) | |
Does the per-user customizations to a notification e-mail (name, timestamp in proper timezone, etc) and sends it out. | |
Public 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. | |
Protected Attributes | |
$body | |
$composed_common | |
User | $editor |
$from | |
$mailTargets = [] | |
$minorEdit | |
$oldid | |
$pageStatus | |
$replyto | |
$subject | |
$summary | |
$timestamp | |
Title | $title |
Private Member Functions | |
canSendUserTalkEmail ( $editor, $title, $minorEdit) | |
composeCommonMailtext () | |
Generate the generic "this page has been changed" e-mail text. | |
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
Definition at line 48 of file EmailNotification.php.
EmailNotification::actuallyNotifyOnPageChange | ( | $editor, | |
$title, | |||
$timestamp, | |||
$summary, | |||
$minorEdit, | |||
$oldid, | |||
$watchers, | |||
$pageStatus = 'changed' ) |
Immediate version of notifyOnPageChange().
Send emails corresponding to the user $editor editing the page $title.
User | $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 176 of file EmailNotification.php.
References $editor, $minorEdit, $oldid, $pageStatus, $summary, $timestamp, $title, $wgBlockDisablesLogin, $wgEnotifMinorEdits, $wgEnotifUserTalk, $wgEnotifWatchlist, $wgUsersNotifiedOnAllChanges, and(), canSendUserTalkEmail(), compose(), User\getName(), User\isAllowed(), UserArray\newFromIDs(), User\newFromName(), NS_USER_TALK, sendMails(), and title.
|
private |
Definition at line 254 of file EmailNotification.php.
References $editor, $minorEdit, $wgBlockDisablesLogin, $wgEnotifUserTalk, and(), User\getId(), User\newFromName(), NS_USER_TALK, and wfDebug().
Referenced by actuallyNotifyOnPageChange(), and notifyOnPageChange().
EmailNotification::compose | ( | $user, | |
$source ) |
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.
User | $user | |
string | $source |
Definition at line 406 of file EmailNotification.php.
References $source, $wgEnotifImpersonal, composeCommonMailtext(), MailAddress\newFromUser(), and sendPersonalised().
Referenced by actuallyNotifyOnPageChange().
|
private |
Generate the generic "this page has been changed" e-mail text.
Definition at line 288 of file EmailNotification.php.
References $body, $keys, $oldid, $summary, $wgEnotifFromEditor, $wgEnotifImpersonal, $wgEnotifRevealEditorAddress, $wgEnotifUseRealName, $wgNoReplyAddress, $wgPasswordSender, and(), MailAddress\newFromUser(), text, title, wfExpandUrl(), and wfMessage().
Referenced by compose().
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 87 of file EmailNotification.php.
References $pageStatus.
EmailNotification::notifyOnPageChange | ( | $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.
User | $editor | |
Title | $title | |
string | $timestamp | |
string | $summary | |
bool | $minorEdit | |
bool | $oldid | (default: false) |
string | $pageStatus | (default: 'changed') |
Definition at line 104 of file EmailNotification.php.
References $editor, $minorEdit, $oldid, $pageStatus, $summary, $timestamp, $wgEnotifMinorEdits, $wgEnotifUserTalk, $wgUsersNotifiedOnAllChanges, canSendUserTalkEmail(), User\getId(), User\getName(), User\isAllowed(), and NS_USER_TALK.
EmailNotification::sendImpersonal | ( | $addresses | ) |
Same as sendPersonalised but does impersonal mail suitable for bulk mailing.
Takes an array of MailAddress objects.
MailAddress[] | $addresses |
Definition at line 480 of file EmailNotification.php.
References $body, and(), UserMailer\send(), text, and wfMessage().
Referenced by sendMails().
EmailNotification::sendMails | ( | ) |
Send any queued mails.
Definition at line 423 of file EmailNotification.php.
References $wgEnotifImpersonal, and sendImpersonal().
Referenced by actuallyNotifyOnPageChange().
EmailNotification::sendPersonalised | ( | $watchingUser, | |
$source ) |
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).
User | $watchingUser | |
string | $source |
Definition at line 441 of file EmailNotification.php.
References $body, $source, $wgEnotifUseRealName, and(), MailAddress\newFromUser(), and UserMailer\send().
Referenced by compose().
|
protected |
Definition at line 63 of file EmailNotification.php.
Referenced by composeCommonMailtext(), sendImpersonal(), and sendPersonalised().
|
protected |
Definition at line 64 of file EmailNotification.php.
|
protected |
Definition at line 75 of file EmailNotification.php.
Referenced by actuallyNotifyOnPageChange(), canSendUserTalkEmail(), and notifyOnPageChange().
|
protected |
Definition at line 63 of file EmailNotification.php.
|
protected |
Definition at line 65 of file EmailNotification.php.
|
protected |
Definition at line 64 of file EmailNotification.php.
Referenced by actuallyNotifyOnPageChange(), canSendUserTalkEmail(), and notifyOnPageChange().
|
protected |
Definition at line 64 of file EmailNotification.php.
Referenced by actuallyNotifyOnPageChange(), composeCommonMailtext(), and notifyOnPageChange().
|
protected |
Definition at line 64 of file EmailNotification.php.
Referenced by actuallyNotifyOnPageChange(), getPageStatus(), and notifyOnPageChange().
|
protected |
Definition at line 63 of file EmailNotification.php.
|
protected |
Definition at line 63 of file EmailNotification.php.
|
protected |
Definition at line 64 of file EmailNotification.php.
Referenced by actuallyNotifyOnPageChange(), composeCommonMailtext(), and notifyOnPageChange().
|
protected |
Definition at line 64 of file EmailNotification.php.
Referenced by actuallyNotifyOnPageChange(), and notifyOnPageChange().
|
protected |
Definition at line 70 of file EmailNotification.php.
Referenced by actuallyNotifyOnPageChange().
const EmailNotification::ALL_CHANGES = 'all_changes' |
Notification because user is notified for all changes.
Definition at line 61 of file EmailNotification.php.
const EmailNotification::USER_TALK = 'user_talk' |
Notification is due to user's user talk being edited.
Definition at line 53 of file EmailNotification.php.
const EmailNotification::WATCHLIST = 'watchlist' |
Notification is due to a watchlisted page being edited.
Definition at line 57 of file EmailNotification.php.