woolio 安装 Default User Preference。
composer require fof/default-user-preferences
修改 此插件的 extend.php
(不是根目录的),其中一行是注释,请根据需要删除对应的选项。
<?php
namespace FoF\DefaultUserPreferences;
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 (['byobuPrivateDiscussionCreated','byobuPrivateDiscussionAdded','byobuRecipientRemoved','byobuPrivateDiscussionReplied','warning',''] as $key) {
$event->user->setPreference(
User::getNotificationPreferenceKey("{$key}", 'email'),
false
);
};
$event->user->save();
});
},
];