add icon support for user settings

This commit is contained in:
Matthias 2022-04-05 01:53:41 +02:00
parent 5b9f84a90f
commit 5f4c8b3a3e
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076
2 changed files with 3 additions and 1 deletions

View File

@ -18,6 +18,7 @@ class NotificationMethod:
"""
METHOD_NAME = ''
METHOD_ICON = None
CONTEXT_BUILTIN = ['name', 'message', ]
CONTEXT_EXTRA = []
GLOBAL_SETTING = None
@ -156,7 +157,7 @@ class MethodStorageClass:
# save definition
methods.append({
'key': new_key,
'icon': 'envelope',
'icon': getattr(item, 'METHOD_ICON', ''),
'method': item.METHOD_NAME,
})
return methods

View File

@ -36,6 +36,7 @@ class CoreNotificationsPlugin(SettingsMixin, IntegrationPluginBase):
class EmailNotification(PlgMixin, BulkNotificationMethod):
METHOD_NAME = 'mail'
METHOD_ICON = 'fa-envelope'
CONTEXT_EXTRA = [
('template', ),
('template', 'html', ),