diff --git a/InvenTree/common/models.py b/InvenTree/common/models.py index bb7de56e99..70084adfde 100644 --- a/InvenTree/common/models.py +++ b/InvenTree/common/models.py @@ -1239,14 +1239,6 @@ class InvenTreeUserSetting(BaseInvenTreeSetting): 'default': True, 'validator': bool, }, - - 'NOTIFICATION_SEND_EMAILS': { - 'name': _('Enable email notifications'), - 'description': _('Allow sending of emails for event notifications'), - 'default': True, - 'validator': bool, - }, - 'LABEL_ENABLE': { 'name': _('Enable label printing'), 'description': _('Enable label printing from the web interface'), diff --git a/InvenTree/plugin/builtin/integration/core_notifications.py b/InvenTree/plugin/builtin/integration/core_notifications.py index 18c62cfdf0..ef1598205c 100644 --- a/InvenTree/plugin/builtin/integration/core_notifications.py +++ b/InvenTree/plugin/builtin/integration/core_notifications.py @@ -6,12 +6,12 @@ from django.utils.translation import ugettext_lazy as _ from allauth.account.models import EmailAddress from plugin import IntegrationPluginBase -from plugin.mixins import BulkNotificationMethod +from plugin.mixins import BulkNotificationMethod, SettingsMixin from common.models import InvenTreeUserSetting import InvenTree.tasks -class CoreNotificationsPlugin(IntegrationPluginBase): +class CoreNotificationsPlugin(SettingsMixin, IntegrationPluginBase): """ Core notification methods for InvenTree """ @@ -20,6 +20,15 @@ class CoreNotificationsPlugin(IntegrationPluginBase): AUTHOR = _('InvenTree contributors') DESCRIPTION = _('Integrated outgoing notificaton methods') + SETTINGS = { + 'NOTIFICATION_SEND_EMAILS': { + 'name': _('Enable email notifications'), + 'description': _('Allow sending of emails for event notifications'), + 'default': True, + 'validator': bool, + }, + } + class EmailNotification(BulkNotificationMethod): METHOD_NAME = 'mail' CONTEXT_EXTRA = [