*/
class MailAddress {
/**
- * @param mixed $address String with an email address, or a User object
- * @param string $name Human-readable name if a string address is given
+ * @param $address Mixed: string with an email address, or a User object
+ * @param $name String: human-readable name if a string address is given
*/
function __construct( $address, $name=null ) {
if( is_object( $address ) && $address instanceof User ) {
$headers['From'] = $from->toString();
- if ($wgEnotifImpersonal)
+ if ($wgEnotifImpersonal) {
$headers['To'] = 'undisclosed-recipients:;';
- else
- $headers['To'] = $to->toString();
+ }
+ else {
+ $headers['To'] = implode( ", ", (array )$dest );
+ }
if ( $replyto ) {
$headers['Reply-To'] = $replyto->toString();
*/
function actuallyNotifyOnPageChange($editor, $title, $timestamp, $summary, $minorEdit, $oldid=false) {
- # we use $wgEmergencyContact as sender's address
+ # we use $wgPasswordSender as sender's address
global $wgEnotifWatchlist;
global $wgEnotifMinorEdits, $wgEnotifUserTalk, $wgShowUpdatedMarker;
global $wgEnotifImpersonal;
} elseif ( $targetUser->getId() == $editor->getId() ) {
wfDebug( __METHOD__.": user edited their own talk page, no notification sent\n" );
} elseif( $targetUser->getOption( 'enotifusertalkpages' ) ) {
- wfDebug( __METHOD__.": sending talk page update notification\n" );
- $this->compose( $targetUser );
- $userTalkId = $targetUser->getId();
+ if( $targetUser->isEmailConfirmed() ) {
+ wfDebug( __METHOD__.": sending talk page update notification\n" );
+ $this->compose( $targetUser );
+ $userTalkId = $targetUser->getId();
+ } else {
+ wfDebug( __METHOD__.": talk page owner doesn't have validated email\n" );
+ }
} else {
wfDebug( __METHOD__.": talk page owner doesn't want notifications\n" );
}
* @private
*/
function composeCommonMailtext() {
- global $wgEmergencyContact, $wgNoReplyAddress;
+ global $wgPasswordSender, $wgNoReplyAddress;
global $wgEnotifFromEditor, $wgEnotifRevealEditorAddress;
global $wgEnotifImpersonal;
# global configuration level.
$editor = $this->editor;
$name = $editor->getName();
- $adminAddress = new MailAddress( $wgEmergencyContact, 'WikiAdmin' );
+ $adminAddress = new MailAddress( $wgPasswordSender, 'WikiAdmin' );
$editorAddress = new MailAddress( $editor );
if( $wgEnotifRevealEditorAddress
&& ( $editor->getEmail() != '' )