streaps I would love to try your local extender.
This should take care of some of the notifications ð
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
use Flarum\User\Event\Registered;
use Flarum\User\User;
use Flarum\Extend;
return [
(new Extend\Event)
->listen(Registered::class, function (Registered $event) {
foreach ([
'postMentioned',
'userMentioned',
'newPost',
'newDiscussionInTag',
'newPostInTag',
'newDiscussionTag',
'discussionCreated',
'postUnapproved',
'userCreated'
] as $key) {
$event->user->setPreference(
User::getNotificationPreferenceKey("{$key}", 'email'),
false
);
}
$event->user->setPreference('followAfterReply', false);
$event->user->save();
})
];
You should be able to add more to the array if you know the serialized type for the notification in question.