mirror of
https://github.com/discourse/discourse.git
synced 2026-08-13 06:25:11 -05:00
DEV: Add bookmark_id to bookmark reminder_handler notifications (#17547)
This is so we can join the Notification table onto the Bookmark table. A slight refactor was needed to ensure that the required values are always included and the consumer does not need to think about this. The discourse-chat and discourse-data-explorer plugins will be updated to take advantage of this commit.
This commit is contained in:
@@ -36,16 +36,14 @@ class TopicBookmarkable < BaseBookmarkable
|
||||
end
|
||||
|
||||
def self.reminder_handler(bookmark)
|
||||
bookmark.user.notifications.create!(
|
||||
notification_type: Notification.types[:bookmark_reminder],
|
||||
send_reminder_notification(
|
||||
bookmark,
|
||||
topic_id: bookmark.bookmarkable_id,
|
||||
post_number: 1,
|
||||
data: {
|
||||
title: bookmark.bookmarkable.title,
|
||||
display_username: bookmark.user.username,
|
||||
bookmark_name: bookmark.name,
|
||||
bookmarkable_url: bookmark.bookmarkable.first_post.url
|
||||
}.to_json
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user