mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-23 23:44:53 +00:00
Set echo preferences for new users after their account is created
Default settings for existing users are intended to be low volume and not annoying New users need more encouragement and incentive to return Change-Id: Id37ad8289a5c968ae8be6a8c424a19d6cbc7e071
This commit is contained in:
parent
51bd09e3aa
commit
073ef28599
13
Echo.php
13
Echo.php
|
@ -409,16 +409,15 @@ $wgDefaultUserOptions['echo-notify-show-link'] = true;
|
|||
// By default, send emails for each notification as they come in
|
||||
$wgDefaultUserOptions['echo-email-frequency'] = EchoHooks::EMAIL_IMMEDIATELY;
|
||||
|
||||
// Set all of the events to notify by web and email by default (won't affect events that don't email)
|
||||
// Set all of the events to notify by web but not email by default (won't affect events that don't email)
|
||||
foreach ( $wgEchoNotificationCategories as $category => $categoryData ) {
|
||||
foreach ( $wgEchoNotifiers as $notifierType => $notifierData ) {
|
||||
$wgDefaultUserOptions["echo-subscriptions-{$notifierType}-{$category}"] = true;
|
||||
}
|
||||
$wgDefaultUserOptions["echo-subscriptions-email-{$category}"] = false;
|
||||
$wgDefaultUserOptions["echo-subscriptions-web-{$category}"] = true;
|
||||
}
|
||||
|
||||
// unset default notifications for reverted (change them to opt-in)
|
||||
$wgDefaultUserOptions['echo-subscriptions-email-reverted'] = false;
|
||||
$wgDefaultUserOptions['echo-subscriptions-web-reverted'] = false;
|
||||
// most settings default to web on, email off, but override these two
|
||||
$wgDefaultUserOptions['echo-subscriptions-email-edit-user-talk'] = true;
|
||||
$wgDefaultUserOptions['echo-subscriptions-web-article-linked'] = false;
|
||||
|
||||
// Echo Configuration for EventLogging
|
||||
$wgEchoConfig = array(
|
||||
|
|
11
Hooks.php
11
Hooks.php
|
@ -446,6 +446,17 @@ class EchoHooks {
|
|||
* @return bool
|
||||
*/
|
||||
public static function onAccountCreated( $user, $byEmail ) {
|
||||
|
||||
// new users get echo preferences set that are not the default settings for existing users
|
||||
$user->setOption( 'echo-subscriptions-web-reverted', false );
|
||||
$user->setOption( 'echo-subscriptions-email-reverted', false );
|
||||
$user->setOption( 'echo-subscriptions-web-article-linked', true );
|
||||
$user->setOption( 'echo-subscriptions-email-mention', true );
|
||||
$user->setOption( 'echo-subscriptions-email-page-review', true );
|
||||
$user->setOption( 'echo-subscriptions-email-edit-thank', true );
|
||||
$user->setOption( 'echo-subscriptions-email-article-linked', true );
|
||||
$user->saveSettings();
|
||||
|
||||
EchoEvent::create( array(
|
||||
'type' => 'welcome',
|
||||
'agent' => $user,
|
||||
|
|
Loading…
Reference in a new issue