Index: trunk/extensions/CategoryWatch/CategoryWatch.php |
— | — | @@ -70,7 +70,6 @@ |
71 | 71 | |
72 | 72 | # Notify watchers of each cat about the addition or removal of this article |
73 | 73 | if (count($add) > 0 || count($sub) > 0) { |
74 | | - $enotif = new EmailNotification(); # ensure UserMailer class is autoloaded |
75 | 74 | $page = $article->getTitle()->getText(); |
76 | 75 | if (count($add) == 1 && count($sub) == 1) { |
77 | 76 | $add = array_shift($add); |
— | — | @@ -130,13 +129,24 @@ |
131 | 130 | $editor->getName(), |
132 | 131 | $message |
133 | 132 | ); |
134 | | - UserMailer::send( |
135 | | - $to, |
136 | | - $from, |
137 | | - wfMsg('categorywatch-emailsubject', $page), |
138 | | - $body, |
139 | | - $replyto |
140 | | - ); |
| 133 | + if (function_exists('userMailer')) { |
| 134 | + userMailer( |
| 135 | + $to, |
| 136 | + $from, |
| 137 | + wfMsg('categorywatch-emailsubject', $page), |
| 138 | + $body, |
| 139 | + $replyto |
| 140 | + ); |
| 141 | + } |
| 142 | + else { |
| 143 | + UserMailer::send( |
| 144 | + $to, |
| 145 | + $from, |
| 146 | + wfMsg('categorywatch-emailsubject', $page), |
| 147 | + $body, |
| 148 | + $replyto |
| 149 | + ); |
| 150 | + } |
141 | 151 | } |
142 | 152 | } |
143 | 153 | |