https://bugzilla.wikimedia.org/show_bug.cgi?id=30104

--- Comment #2 from Dan Barrett <[email protected]> 2011-07-28 19:02:26 
UTC ---
Alternatively, is there an approved way to substitute a different subject line
and body for a notification email, programmatically depending on circumstances?
 In our extension, which watches only for changes to category pages, we
subclass the EmailNotification class and override composeCommonMailtext like
this:

class CategoryWatcherEmailNotification extends EmailNotification {
  var $mySubject;
  var $myBody;

  // Override the body and subject                                              
  function composeCommonMailtext() {
    $result = parent::composeCommonMailtext();
    if ($this->mySubject) { $this->subject = $this->mySubject; }
    if ($this->myBody) { $this->body = $this->myBody; }
  }
  ...

Then we attach to the LinksUpdate hook with a callback that creates a
CategoryWatcherEmailNotification object (instead of an EmailNotification) and
runs notifyOnPageChange().

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to