X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FUserMailer.php;h=ac1b0f45db761ea417ac21ded473428397c0b31e;hb=25c2891ceb5da61f9cda8bef0e017fe169faec55;hp=2bb3d9ab4da2e216fdcf3495543d64075569f5cc;hpb=7d0f0c6396a1059f9ac00299df3ca473a1a67537;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/UserMailer.php b/includes/UserMailer.php index 2bb3d9ab4d..ac1b0f45db 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -68,7 +68,7 @@ function userMailer( $to, $from, $subject, $body, $replyto=false ) { // Create the mail object using the Mail::factory method $mail_object =& Mail::factory('smtp', $wgSMTP); - + wfDebug( "Sending mail via PEAR::Mail\n" ); $mailResult =& $mail_object->send($to, $headers, $body); # Based on the result return an error string, @@ -93,6 +93,7 @@ function userMailer( $to, $from, $subject, $body, $replyto=false ) { $wgErrorString = ''; set_error_handler( 'mailErrorHandler' ); + wfDebug( "Sending mail via internal mail() function\n" ); mail( $to, $subject, $body, $headers ); restore_error_handler(); @@ -258,7 +259,8 @@ class EmailNotification { # http://bugzilla.wikipeda.org/show_bug.cgi?id=603 "Delete + undelete cycle doesn't preserve old_id" # However, in the case of a new page which is already watched, we have no previous version to compare if( $this->oldid ) { - $keys['$NEWPAGE'] = wfMsgForContent( 'enotif_lastvisited' ); + $difflink = $this->title->getFullUrl( 'diff=0&oldid=' . $this->oldid ); + $keys['$NEWPAGE'] = wfMsgForContent( 'enotif_lastvisited', $difflink ); $keys['$OLDID'] = $this->oldid; $keys['$CHANGEDORCREATED'] = wfMsgForContent( 'changed' ); } else { @@ -271,10 +273,9 @@ class EmailNotification { $body = strtr( $body, $keys ); $pagetitle = $this->title->getPrefixedText(); - $keys['%24PAGETITLE_RAWURL'] = wfUrlencode( $pagetitle ); - $keys['$PAGETITLE_RAWURL'] = wfUrlencode( $pagetitle ); - $keys['%24PAGETITLE'] = $pagetitle; # needed for the {{localurl:$PAGETITLE}} in the messagetext, "$" appears here as "%24" $keys['$PAGETITLE'] = $pagetitle; + $keys['$PAGETITLE_URL'] = $this->title->getFullUrl(); + $keys['$PAGETIMESTAMP'] = $article->mTimestamp; # this is the raw internal timestamp - can be useful, too $keys['$PAGEMINOREDIT'] = $medit; $keys['$PAGESUMMARY'] = $summary; @@ -307,19 +308,20 @@ class EmailNotification { $anonUrl = wfUrlencode( $name ) . ' (anonymous user)'; $subject = str_replace('$PAGEEDITOR', 'anonymous user '. $name, $subject); - $keys['$PAGEEDITOR_RAWURL'] = $anonUrl; - $keys['%24PAGEEDITOR_RAWURL'] = $anonUrl; - $keys['%24PAGEEDITORE'] = $anon; - $keys['$PAGEEDITOR'] = 'anonymous user ' . $name; + $keys['$PAGEEDITOR'] = 'anonymous user ' . $name; + $keys['$PAGEEDITOR_EMAIL'] = wfMsgForContent( 'noemailtitle' ); } else { $subject = str_replace('$PAGEEDITOR', $name, $subject); - $keys['$PAGEEDITOR_RAWURL'] = wfUrlencode( $name ); - $keys['%24PAGEEDITOR_RAWURL'] = wfUrlencode( $name ); - $keys['%24PAGEEDITORE'] = $wgUser->getTitleKey(); $keys['$PAGEEDITOR'] = $name; + $emailPage = Title::makeTitle( NS_SPECIAL, 'Emailuser/' . $name ); + $keys['$PAGEEDITOR_EMAIL'] = $emailPage->getFullUrl(); } + $userPage = $wgUser->getUserPage(); + $keys['$PAGEEDITOR_WIKI'] = $userPage->getFullUrl(); $body = strtr( $body, $keys ); - + + $body = wordwrap( $body, 72 ); + # now save this as the constant user-independent part of the message $this->from = $from; $this->replyto = $replyto;