psachdeva That's still a very easy thing to do.
Fork the extension and change the true
value to false
, that's all. I have done it before, for a different use case rather.
Or simply place this code in the extend.php
of your root directory;
use Flarum\User\Event\Registered;
use Flarum\User\User;
use Illuminate\Events\Dispatcher;
return [
function (Dispatcher $events) {
$events->listen(Registered::class, function (Registered $event) {
foreach (['post', 'user'] as $key) {
$event->user->setPreference(
User::getNotificationPreferenceKey("{$key}Mentioned", 'email'),
false
);
}
$event->user->setPreference('discloseOnline', false);
$event->user->save();
});
},
];
The above code works for your use case;
psachdeva For instance, if we want to make it that default settings for email notifications and showing if a user is online are off?
Newly Registered Users, Would Have The Default Settings Of;
- All email notifications - Off.
- If a user is online - Off.