make setting global

This commit is contained in:
Matthias 2022-04-02 03:16:14 +02:00
parent c7329da7e0
commit 6124b1207d
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -21,7 +21,7 @@ class CoreNotificationsPlugin(SettingsMixin, IntegrationPluginBase):
DESCRIPTION = _('Integrated outgoing notificaton methods')
SETTINGS = {
'NOTIFICATION_SEND_EMAILS': {
'ENABLE_NOTIFICATION_EMAILS': {
'name': _('Enable email notifications'),
'description': _('Allow sending of emails for event notifications'),
'default': True,
@ -43,6 +43,10 @@ class CoreNotificationsPlugin(SettingsMixin, IntegrationPluginBase):
only for users which allow email notifications
"""
# Check if method globally enabled
if not self.get_setting('ENABLE_NOTIFICATION_EMAILS'):
return
allowed_users = []
for user in self.targets: