-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
enhancementNew feature or requestNew feature or request
Description
👋 Hi Maurice, thanks for this great plugin!
The new version has also turned out very well.
I have a use case that cannot be implemented with the plugin at the moment, but I think it could be quite helpful to others as well.
I have a comment area where comments should be published automatically depending on the user type (blueprint). For example, all admins or editors. However, this list is dynamic and cannot be mapped using a static array of e-mail addresses in the config.
I think the function could be solved by moderation.autoPublish not only accepting an array, but also a closure that returns the permitted e-mail addresses. Like…
'autoPublish' => function () {
$allowedEmails = [];
$users = kirby()->users()->filter(function($user) {
return $user->blueprint()->name() === 'users/admin' || $user->blueprint()->name() === 'users/editor';
});
foreach($users as $user) {
$allowedEmails[] = $user->email();
}
return $allowedEmails;
}What do you think?
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request