Last modified: 2011-07-29 06:55:51 UTC
In 1.17.0, the function EmailNotification::composeCommonMailtext() in UserMailer.php was changed from public to private. Could this change please be reversed? I have extensions that invoke/override this method and they've broken as a result. Thank you very much.
Created attachment 8831 [details] Patch for this ticket
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().
Never mind, you can close this ticket. I figured out that I can override sendPersonalised() instead of composeCommonMailtext(). Now please don't make sendPersonalised() private. :-)
+patch