On Thu, Nov 8, 2012 at 10:59 AM, Platonides platonides@gmail.com wrote:
Hola Javier,
Did you look at http://www.mediawiki.org/wiki/Enotif#Notification_mail_.28text_templates_and... ?
No, there's no variable holding the diff. Available variables seem to be $NEWPAGE, $OLDID, $CHANGEDORCREATED, $PAGETITLE, $PAGETITLE_URL, $PAGEMINOREDIT, $UNWATCHURL, $PAGEEDITOR, $PAGEEDITOR_EMAIL, $PAGEEDITOR_WIKI, $PAGESUMMARY, $WATCHINGUSERNAME, $PAGEEDITDATE and $PAGEEDITTIME.
As to how to do that, I would hook on AbortEmailNotification, and perform the same $enotif = new EmailNotification();, $enotif->notifyOnPageChange( ... ); but with my own class instead. Make that class child of EmailNotification. Override the composeCommonMailtext() with your own one, which calls parent::composeCommonMailtext() and then appends to $this->body the diff (nto straightforward, you will need to recover it from $this->oldid). Yes, composeCommonMailtext would need to be changed to protected. Seems a fair change. That class is not too well organised.
Seems a feature we could want to merge upstream, too.
Regards
Thank you Platonides. You were very clear. So, I understand that the real problem is how to get the diff (the specific diffs, not the link to diffs) from $this within EmailNotification class. Could be a good for users who want to see what changed directly in the mail notification.
On 12/11/12 17:10, Javier del Pozo wrote:
Thank you Platonides. You were very clear. So, I understand that the real problem is how to get the diff (the specific diffs, not the link to diffs) from $this within EmailNotification class.
Not really a problem, but not as available as a variable holding the diff. :) You have $this->oldid, so you can perform in that new class the same steps as when visiting in the browser index.php?oldid=1234&diff=prev
Could be a good for users who want to see what changed directly in the mail notification.
Yes. A small caveat: the wiki may be configured not to send new notifications until you visit the watched page again. When you are forced to visit the link, it happens automatically (if you are logged in), but if the user treats it as "seen" from the email, the wiki doesn't know that.
Regards
mediawiki-api@lists.wikimedia.org