docbrown/app/services/notifications
Vaidehi Joshi f71c8b16e7
Allow dynamic authoring of welcome notifications (#6045) [deploy]
* Add "Welcome" type to Broadcasts, allow dynamic "authoring" of Broadcasts

This adds a new `type_of` to the Broadcast model: "Welcome". As we begin to create a new "welcome notification" workflow, we'll categorize them by making them all of the same type.

This also adds a concept of a "welcoming user", which can be set via an ENV var. The WELCOMING_USER_ID will allow us to explicitly set (and change) which user in the database is the one that "sends" welcoming notification. In production, we plan for this to be dev.to/sloan.

* Allow WelcomeNotificationWorker to accept + send any kind of broadcast

This abstracts out the logic of deciding which broadcast to send from the woker into the calling method. This will help us send many different kinds of welcome notifications using one, resuable worker class.

* Raise if a Notification can't be created

* Add STAFF_USER_ID as an ENV var

This is in preparation for moving away from SiteConfig.staff_user_id, and replacing it with an ENV var. We will need to set this in production first, and then make a separate PR to replace all instances of staff_user_id with the newly-set ENV var.
2020-02-12 13:50:37 -08:00
..
milestone send_milestone_notification in own job (#2804) 2019-05-16 13:46:50 -04:00
moderation Moved send_mention_notification to ActiveJob (#3566) 2019-08-01 16:35:25 -04:00
new_badge_achievement Move send new badge achievement notification to ActiveJob (#2474) 2019-04-29 10:51:08 -04:00
new_comment Refactor app/services/notifications/new_comment#send (#4642) 2019-10-30 12:21:56 -04:00
new_follower Create new NewFollowerWorker and start sending jobs to it (#5556) [deploy] 2020-01-17 15:08:50 -05:00
new_mention Fix mention notification to mention proper user (#3721) 2019-08-14 14:43:21 -04:00
notifiable_action Specify on_duplicate_key_update when creating notifications to avoid constraint violation (#4993) [deploy] 2019-12-03 16:24:46 -05:00
reactions Handle Reactions Without Users When Sending Notifications (#5820) 2020-02-07 14:10:52 -05:00
tag_adjustment_notification Improve mod roundrobin notification and internal tooling (#3855) 2019-08-27 21:54:09 -04:00
welcome_notification Allow dynamic authoring of welcome notifications (#6045) [deploy] 2020-02-12 13:50:37 -08:00
moderation.rb Improve mod roundrobin notification and internal tooling (#3855) 2019-08-27 21:54:09 -04:00
remove_all.rb Refactor remove_all and remove_each notifications and fix orphaned notifications (#3570) 2019-09-25 15:31:56 -04:00
remove_all_by_action.rb Refactor remove_all and remove_each notifications and fix orphaned notifications (#3570) 2019-09-25 15:31:56 -04:00
update.rb Remove .first query on notifications (#5943) 2020-02-07 08:58:51 -05:00