MediaWiki  REL1_20
EmailNotification Class Reference

This module processes the email notifications when the current page is changed. More...

Collaboration diagram for EmailNotification:

List of all members.

Public Member Functions

 actuallyNotifyOnPageChange ($editor, $title, $timestamp, $summary, $minorEdit, $oldid, $watchers)
 Immediate version of notifyOnPageChange().
 compose ($user)
 Compose a mail to a given user and either queue it for sending, or send it now, depending on settings.
 notifyOnPageChange ($editor, $title, $timestamp, $summary, $minorEdit, $oldid=false)
 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.

Public Attributes

 $body
 $composed_common
 $from
 $minorEdit
 $oldid
 $replyto
 $summary

Protected Attributes

User $editor
 $mailTargets = array()
 $subject
 $timestamp
Title $title

Private Member Functions

 canSendUserTalkEmail ($editor, $title, $minorEdit)
 composeCommonMailtext ()
 Generate the generic "this page has been changed" e-mail text.
 sendPersonalised ($watchingUser)
 Does the per-user customizations to a notification e-mail (name, timestamp in proper timezone, etc) and sends it out.

Detailed Description

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:

  • Each watching user will be notified about the page edit time expressed in his/her local time (UTC is shown additionally). To achieve this, we need to find the individual timeoffset of each watching user from the preferences..

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 http://meta.wikipedia.com/Enotif

Definition at line 396 of file UserMailer.php.


Member Function Documentation

EmailNotification::actuallyNotifyOnPageChange ( editor,
title,
timestamp,
summary,
minorEdit,
oldid,
watchers 
)

Immediate version of notifyOnPageChange().

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

Parameters:
$editorUser object
$titleTitle object
$timestampstring Edit timestamp
$summarystring Edit summary
$minorEditbool
$oldidint Revision ID
$watchersarray of user IDs

Definition at line 512 of file UserMailer.php.

EmailNotification::canSendUserTalkEmail ( editor,
title,
minorEdit 
) [private]
Parameters:
$editorUser
$titleTitle bool
$minorEdit
Returns:
bool

Definition at line 578 of file UserMailer.php.

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.

Parameters:
$userUser

Definition at line 705 of file UserMailer.php.

Generate the generic "this page has been changed" e-mail text.

Definition at line 608 of file UserMailer.php.

EmailNotification::notifyOnPageChange ( editor,
title,
timestamp,
summary,
minorEdit,
oldid = false 
)

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

Also updates wl_notificationtimestamp.

May be deferred via the job queue.

Parameters:
$editorUser object
$titleTitle object
$timestamp
$summary
$minorEdit
$oldid(default: false)

Definition at line 422 of file UserMailer.php.

Same as sendPersonalised but does impersonal mail suitable for bulk mailing.

Takes an array of MailAddress objects.

Returns:
Status

Definition at line 764 of file UserMailer.php.

Send any queued mails.

Definition at line 721 of file UserMailer.php.

EmailNotification::sendPersonalised ( watchingUser) [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.

Parameters:
$watchingUserUser object
Returns:
Boolean

Definition at line 737 of file UserMailer.php.


Member Data Documentation

EmailNotification::$body

Definition at line 397 of file UserMailer.php.

EmailNotification::$composed_common

Definition at line 398 of file UserMailer.php.

User EmailNotification::$editor [protected]

Definition at line 407 of file UserMailer.php.

EmailNotification::$from

Definition at line 397 of file UserMailer.php.

EmailNotification::$mailTargets = array() [protected]

Definition at line 399 of file UserMailer.php.

EmailNotification::$minorEdit

Definition at line 398 of file UserMailer.php.

EmailNotification::$oldid

Definition at line 398 of file UserMailer.php.

EmailNotification::$replyto

Definition at line 397 of file UserMailer.php.

EmailNotification::$subject [protected]

Definition at line 397 of file UserMailer.php.

EmailNotification::$summary

Definition at line 398 of file UserMailer.php.

EmailNotification::$timestamp [protected]

Definition at line 398 of file UserMailer.php.

Title EmailNotification::$title [protected]

Definition at line 403 of file UserMailer.php.


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