Manual:Hooks/AbortTalkPageEmailNotification

Category:MediaWiki hooks#AbortTalkPageEmailNotification Category:Hooks added in MediaWiki 1.22.0#AbortTalkPageEmailNotification Category:MediaWiki deprecated or obsolete features#AbortTalkPageEmailNotification Category:Hooks deprecated in MediaWiki 1.44.0#AbortTalkPageEmailNotification
AbortTalkPageEmailNotification
Available from version 1.22.0 (Gerrit change 67901)
Disable email notifications of edits to users' talk pages.
Define function:
public static function onAbortTalkPageEmailNotification( User $targetUser, Title $title ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"AbortTalkPageEmailNotification": "MediaWiki\\Extension\\MyExtension\\Hooks::onAbortTalkPageEmailNotification"
	}
}
Called from: File(s): includes/mail/EmailNotification.phpCategory:MediaWiki hooks included in EmailNotification.php#AbortTalkPageEmailNotification
Function(s): canSendUserTalkEmail
Interface: AbortTalkPageEmailNotificationHook.php

For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:AbortTalkPageEmailNotification extensions.

This hook allows extensions to disable the regular talk page email notifications.

For example, Extension:Echo does this because it creates a new system of notifications (including to send an email, if the user desires, which would otherwise result in more than one email notification).

Parameters

Handlers of this hook receive two parameters:

  • User $targetUser The user who's talk page is being edited, to whom the notification will be sent.
    This is equivalent to $targetUser = User::newFromName( $title->getText() );
  • Title $title The Title of the talk page.

Return values

Handlers of this hook should return:

  • false to disable the built-in email notification; or
  • true to enable it.
Category:Hooks added in MediaWiki 1.22.0 Category:Hooks deprecated in MediaWiki 1.44.0 Category:MediaWiki deprecated or obsolete features Category:MediaWiki hooks Category:MediaWiki hooks included in EmailNotification.php