PluginManager refactor (#6677)
* fix: refactor plugin manager * fix: make id optional * fix: allow add to accept single object * fix: getHooks * fix: tsc * fix: remove id
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { PluginManager, PluginType } from "@server/utils/PluginManager";
|
||||
import { Hook, PluginManager } from "@server/utils/PluginManager";
|
||||
import { requireDirectory } from "@server/utils/fs";
|
||||
import BaseEmail from "./BaseEmail";
|
||||
|
||||
@@ -14,8 +14,8 @@ requireDirectory<{ default: BaseEmail<any> }>(__dirname).forEach(
|
||||
}
|
||||
);
|
||||
|
||||
PluginManager.getEnabledPlugins(PluginType.EmailTemplate).forEach((plugin) => {
|
||||
emails[plugin.id] = plugin.value;
|
||||
PluginManager.getHooks(Hook.EmailTemplate).forEach((hook) => {
|
||||
emails[hook.value.name] = hook.value;
|
||||
});
|
||||
|
||||
export default emails;
|
||||
|
||||
Reference in New Issue
Block a user