MediaWiki
1.30.0
|
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(). More... | |
compose ( $user, $source) | |
Compose a mail to a given user and either queue it for sending, or send it now, depending on settings. More... | |
notifyOnPageChange ( $editor, $title, $timestamp, $summary, $minorEdit, $oldid=false, $pageStatus='changed') | |
Send emails corresponding to the user $editor editing the page $title. More... | |
sendImpersonal ( $addresses) | |
Same as sendPersonalised but does impersonal mail suitable for bulk mailing. More... | |
sendMails () | |
Send any queued mails. More... | |
Static Public Member Functions | |
static | updateWatchlistTimestamp (User $editor, LinkTarget $linkTarget, $timestamp) |
Public Attributes | |
$body | |
$composed_common | |
$from | |
$minorEdit | |
$oldid | |
$pageStatus | |
$replyto | |
$summary | |
const | ALL_CHANGES = 'all_changes' |
Notification because user is notified for all changes. More... | |
const | USER_TALK = 'user_talk' |
Notification is due to user's user talk being edited. More... | |
const | WATCHLIST = 'watchlist' |
Notification is due to a watchlisted page being edited. More... | |
Protected Attributes | |
User | $editor |
$mailTargets = [] | |
$subject | |
$timestamp | |
Title | $title |
Private Member Functions | |
canSendUserTalkEmail ( $editor, $title, $minorEdit) | |
composeCommonMailtext () | |
Generate the generic "this page has been changed" e-mail text. More... | |
sendPersonalised ( $watchingUser, $source) | |
Does the per-user customizations to a notification e-mail (name, timestamp in proper timezone, etc) and sends it out. More... | |
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 49 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 190 of file EmailNotification.php.
References $editor, $minorEdit, $name, $oldid, $pageStatus, $summary, $timestamp, $title, $user, $wgBlockDisablesLogin, $wgEnotifMinorEdits, $wgEnotifUserTalk, $wgEnotifWatchlist, $wgUsersNotifiedOnAllChanges, as, canSendUserTalkEmail(), compose(), User\getName(), Title\getNamespace(), Title\getText(), global, User\isAllowed(), UserArray\newFromIDs(), User\newFromName(), NS_USER_TALK, Hooks\run(), sendMails(), and title.
|
private |
Definition at line 269 of file EmailNotification.php.
References $editor, $minorEdit, $title, $wgBlockDisablesLogin, $wgEnotifUserTalk, User\getId(), Title\getNamespace(), Title\getText(), global, User\newFromName(), NS_USER_TALK, Hooks\run(), 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 420 of file EmailNotification.php.
References $source, $user, $wgEnotifImpersonal, composeCommonMailtext(), global, MailAddress\newFromUser(), and sendPersonalised().
Referenced by actuallyNotifyOnPageChange().
|
private |
Generate the generic "this page has been changed" e-mail text.
Definition at line 303 of file EmailNotification.php.
References $body, $keys, $oldid, $summary, $wgEnotifFromEditor, $wgEnotifImpersonal, $wgEnotifRevealEditorAddress, $wgEnotifUseRealName, $wgNoReplyAddress, $wgPasswordSender, from, SpecialPage\getSafeTitleFor(), global, Skin\makeInternalOrExternalUrl(), MailAddress\newFromUser(), MessageCache\singleton(), text, title, wfExpandUrl(), and wfMessage().
Referenced by compose().
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 118 of file EmailNotification.php.
References $editor, $minorEdit, $oldid, $pageStatus, $summary, $timestamp, $title, $wgEnotifMinorEdits, $wgEnotifUserTalk, $wgUsersNotifiedOnAllChanges, canSendUserTalkEmail(), captcha-old\count, User\getId(), RequestContext\getMain(), User\getName(), Title\getNamespace(), global, User\isAllowed(), NS_USER_TALK, and JobQueueGroup\singleton().
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 492 of file EmailNotification.php.
References $body, $wgContLang, from, global, UserMailer\send(), text, and wfMessage().
Referenced by sendMails().
EmailNotification::sendMails | ( | ) |
Send any queued mails.
Definition at line 437 of file EmailNotification.php.
References $wgEnotifImpersonal, global, and sendImpersonal().
Referenced by actuallyNotifyOnPageChange().
|
private |
Does the per-user customizations to a notification e-mail (name, timestamp in proper timezone, etc) and sends it out.
Returns true if the mail was sent successfully.
User | $watchingUser | |
string | $source |
Definition at line 454 of file EmailNotification.php.
References $body, $source, $wgContLang, $wgEnotifUseRealName, from, global, MailAddress\newFromUser(), and UserMailer\send().
Referenced by compose().
|
static |
User | $editor | The editor that triggered the update. Their notification timestamp will not be updated(they have already seen it) |
LinkTarget | $linkTarget | The link target of the title to update timestamps for |
string | $timestamp | Set the update timestamp to this value |
Definition at line 88 of file EmailNotification.php.
References $editor, $timestamp, and RequestContext\getMain().
Referenced by WatchedItemIntegrationTest\testUpdateAndResetNotificationTimestamp().
EmailNotification::$body |
Definition at line 64 of file EmailNotification.php.
Referenced by composeCommonMailtext(), sendImpersonal(), and sendPersonalised().
EmailNotification::$composed_common |
Definition at line 65 of file EmailNotification.php.
|
protected |
Definition at line 76 of file EmailNotification.php.
Referenced by actuallyNotifyOnPageChange(), canSendUserTalkEmail(), notifyOnPageChange(), and updateWatchlistTimestamp().
EmailNotification::$from |
Definition at line 64 of file EmailNotification.php.
|
protected |
Definition at line 66 of file EmailNotification.php.
EmailNotification::$minorEdit |
Definition at line 65 of file EmailNotification.php.
Referenced by actuallyNotifyOnPageChange(), canSendUserTalkEmail(), and notifyOnPageChange().
EmailNotification::$oldid |
Definition at line 65 of file EmailNotification.php.
Referenced by actuallyNotifyOnPageChange(), composeCommonMailtext(), and notifyOnPageChange().
EmailNotification::$pageStatus |
Definition at line 65 of file EmailNotification.php.
Referenced by actuallyNotifyOnPageChange(), and notifyOnPageChange().
EmailNotification::$replyto |
Definition at line 64 of file EmailNotification.php.
|
protected |
Definition at line 64 of file EmailNotification.php.
EmailNotification::$summary |
Definition at line 65 of file EmailNotification.php.
Referenced by actuallyNotifyOnPageChange(), composeCommonMailtext(), and notifyOnPageChange().
|
protected |
Definition at line 65 of file EmailNotification.php.
Referenced by actuallyNotifyOnPageChange(), notifyOnPageChange(), and updateWatchlistTimestamp().
|
protected |
Definition at line 71 of file EmailNotification.php.
Referenced by actuallyNotifyOnPageChange(), canSendUserTalkEmail(), and notifyOnPageChange().
const EmailNotification::ALL_CHANGES = 'all_changes' |
Notification because user is notified for all changes.
Definition at line 62 of file EmailNotification.php.
const EmailNotification::USER_TALK = 'user_talk' |
Notification is due to user's user talk being edited.
Definition at line 54 of file EmailNotification.php.
const EmailNotification::WATCHLIST = 'watchlist' |
Notification is due to a watchlisted page being edited.
Definition at line 58 of file EmailNotification.php.