From 6bbdf5b56e2f02f3910f56b671f41fdac4b3835d Mon Sep 17 00:00:00 2001 From: Penar Musaraj Date: Mon, 15 Apr 2019 10:17:15 -0400 Subject: [PATCH] DEV: add "pre_notification_alert" event Allows plugins to modify payload before sending a notification alert --- app/services/post_alerter.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/services/post_alerter.rb b/app/services/post_alerter.rb index 40d1d41d18b..a71b68bcdbc 100644 --- a/app/services/post_alerter.rb +++ b/app/services/post_alerter.rb @@ -434,6 +434,7 @@ class PostAlerter post_url: post_url } + DiscourseEvent.trigger(:pre_notification_alert, user, payload) MessageBus.publish("/notification-alert/#{user.id}", payload, user_ids: [user.id]) push_notification(user, payload) DiscourseEvent.trigger(:post_notification_alert, user, payload)