mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Add a webhook for user notifications
If enabled, this will fire a webhook whenever a user's notification has been created. This could potentially be a lot of data depending on your forum, and should be used carefully since it includes everything all users will see in their feeds.
This commit is contained in:
@@ -26,6 +26,10 @@ class Notification < ActiveRecord::Base
|
||||
after_commit :send_email, on: :create
|
||||
after_commit :refresh_notification_count, on: [:create, :update, :destroy]
|
||||
|
||||
after_commit(on: :create) do
|
||||
DiscourseEvent.trigger(:notification_created, self)
|
||||
end
|
||||
|
||||
def self.ensure_consistency!
|
||||
DB.exec(<<~SQL, Notification.types[:private_message])
|
||||
DELETE
|
||||
|
Reference in New Issue
Block a user