btw, if a person wants to test this component’s settings without having to do the actual actions that trigger these notifications (and you have ssh access), you can use these commands in the rails console to trigger those respective event notifications (use the triggers applicable to your component’s settings):
cd /var/discourse
.launcher enter app
rails c
# find and set your user variable
u = User.find_by_username("YOUR ADMIN USERNAME")
# trigger: new features
Notification.create!(
user: u,
notification_type: Notification.types[:new_features],
read: false,
data: {}.to_json
)
# trigger: invitee accepted
Notification.create!(
user: u,
notification_type: Notification.types[:invitee_accepted],
read: false,
data: { display_username: "awesome_new_user" }.to_json
)
# trigger: group membership accepted
Notification.create!(
user: u,
notification_type: Notification.types[:membership_request_accepted],
read: false,
data: { group_name: "Trust_Level_4" }.to_json
)
# trigger: granted badge
Notification.create!(
user: u,
notification_type: Notification.types[:granted_badge],
read: false,
data: { badge_name: "Great Topic", badge_id: 10 }.to_json
)
# trigger: upcoming change promoted
Notification.create!(
user: u,
notification_type: Notification.types[:upcoming_change_automatically_promoted],
read: false,
data: {
upcoming_change_humanized_name: "Experimental CSS",
upcoming_change_name: "experimental_css"
}.to_json
)
# broadcast (Watch your browser in another window or tab when you hit enter!)
u.publish_notifications_state
best way to test is to disable the setting in the component you want to test and run the related rails trigger command, see the notification pop up, then enable the setting and do a hard refresh to see them disappear.