On 11/08/2012 01:00 PM, Brad Jorsch wrote:
On Wed, Nov 7, 2012 at 7:20 AM, Javier del Pozojdelpozo@cnb.csic.es wrote:
I need to customize my mediawiki to send added lines in the mail notification of changes (of a watchlist).
Can you help me?
This really has nothing to do with the API, but you would customize the page MediaWiki:enotif_body on your MediaWiki installation.
I am sorry if this message shouldn't be here, but what I need to know is how to bring the changes made to show them in the page MediaWiki:enotif_body. Is there any parameter that contains the last changes usable in enotif_body page? Thank you.
El 08/11/12 15:12, Javier del Pozo escribió:
I am sorry if this message shouldn't be here, but what I need to know is how to bring the changes made to show them in the page MediaWiki:enotif_body. Is there any parameter that contains the last changes usable in enotif_body page? Thank you.
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
mediawiki-api@lists.wikimedia.org