DEV: add "pre_notification_alert" event

Allows plugins to modify payload before sending a notification alert
This commit is contained in:
Penar Musaraj 2019-04-15 10:17:15 -04:00
parent 24fd710f04
commit 6bbdf5b56e

View File

@ -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)