spawn 您可以在安装 Default User Preference 插件后,在 /yourFlarumPath/vendor/fof/default-user-preferences/extend.php
中将 return 部分替换成下方这样,以在用户注册时自动将这个通知关闭:
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( //这里是将被提及的论坛通知关闭,部署时请删除注释
User::getNotificationPreferenceKey("{$key}Mentioned", 'alert'),
false
);
}
$event->user->save();
});
},
];
保存文件后请清理缓存:
php flarum cache:clear