[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/includes/mail/ -> EmailNotification.php (summary)

Classes used to send e-mails This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Author: <[email protected]>
Author: <[email protected]>
Author: Tim Starling
Author: Luke Welling [email protected]
File Size: 512 lines (17 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

EmailNotification:: (9 methods):
  updateWatchlistTimestamp()
  notifyOnPageChange()
  actuallyNotifyOnPageChange()
  canSendUserTalkEmail()
  composeCommonMailtext()
  compose()
  sendMails()
  sendPersonalised()
  sendImpersonal()


Class: EmailNotification  - X-Ref

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
updateWatchlistTimestamp( User $editor, Title $title, $timestamp )   X-Ref

param: User $editor The editor that triggered the update.  Their notification
param: Title $title The title to update timestamps for
param: string $timestamp Set the upate timestamp to this value
return: int[]

notifyOnPageChange( $editor, $title, $timestamp, $summary,$minorEdit, $oldid = false, $pageStatus = 'changed')   X-Ref
No description

actuallyNotifyOnPageChange( $editor, $title, $timestamp, $summary, $minorEdit,$oldid, $watchers, $pageStatus = 'changed' )   X-Ref
Immediate version of notifyOnPageChange().

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

param: User $editor
param: Title $title
param: string $timestamp Edit timestamp
param: string $summary Edit summary
param: bool $minorEdit
param: int $oldid Revision ID
param: array $watchers Array of user IDs
param: string $pageStatus

canSendUserTalkEmail( $editor, $title, $minorEdit )   X-Ref

param: User $editor
param: Title $title
param: bool $minorEdit
return: bool

composeCommonMailtext()   X-Ref
Generate the generic "this page has been changed" e-mail text.


compose( $user )   X-Ref
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.
param: User $user

sendMails()   X-Ref
Send any queued mails


sendPersonalised( $watchingUser )   X-Ref
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.

param: User $watchingUser
return: bool

sendImpersonal( $addresses )   X-Ref
Same as sendPersonalised but does impersonal mail suitable for bulk
mailing.  Takes an array of MailAddress objects.

param: MailAddress[] $addresses
return: Status|null



Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1