mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Email notification filter plugin API (#24271)
This commit is contained in:
committed by
GitHub
parent
daf7608905
commit
e3f8e9c0fb
@@ -99,6 +99,7 @@ class DiscoursePluginRegistry
|
||||
|
||||
define_filtered_register :presence_channel_prefixes
|
||||
|
||||
define_filtered_register :email_notification_filters
|
||||
define_filtered_register :push_notification_filters
|
||||
|
||||
define_filtered_register :notification_consolidation_plans
|
||||
|
||||
@@ -999,6 +999,12 @@ class Plugin::Instance
|
||||
DiscoursePluginRegistry.register_presence_channel_prefix([prefix, block], self)
|
||||
end
|
||||
|
||||
# Registers a new email notification filter. Notification is passed into block, and if all
|
||||
# filters return `true`, the email notification will be sent.
|
||||
def register_email_notification_filter(&block)
|
||||
DiscoursePluginRegistry.register_email_notification_filter(block, self)
|
||||
end
|
||||
|
||||
# Registers a new push notification filter. User and notification payload are passed into block, and if all
|
||||
# filters return `true`, the push notification will be sent.
|
||||
def register_push_notification_filter(&block)
|
||||
|
||||
Reference in New Issue
Block a user