Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: allow admins to modify notification template delivery method #14116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

dannykopping
Copy link
Contributor

@dannykopping dannykopping commented Aug 2, 2024

Part of coder/internal#19

Admins must be able to modify which delivery method is set for each notification template. For all templates with a method not set, it falls back to the deployment-wide setting.

This PR enables the above functionality, and modifies the notification dispatch process to take custom dispatch methods per template into account.

Added two new routes:

  • PUT /notifications/templates/{notification_template}/method
    • Enterprise only, allows admins to modify the delivery method on each notification template
    • Enables use-cases like "send all notifications via email, but send the user account created notification via webhook so I can programmatically update my billing registry"
  • GET /notifications/templates/system
    • AGPL, retrieves all notification templates of kind system
    • this is the only kind right now; in the future we'll have user-defined notification templates

Also made some small drive-by changes to the notification settings work recently implemented.

Copy link
Contributor Author

dannykopping commented Aug 2, 2024

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @dannykopping and the rest of your teammates on Graphite Graphite

@dannykopping dannykopping changed the title Update template method API feat: allow admins to modify notification template delivery method Aug 2, 2024
@dannykopping dannykopping added the enterprise Enterprise-license / premium functionality label Aug 2, 2024 — with Graphite App
Copy link

alwaysmeticulous bot commented Aug 2, 2024

Meticulous was unable to execute a test run for this PR because the most recent commit is associated with multiple PRs. To execute a test run, please try pushing up a new commit that is only associated with this PR.

Last updated for commit 33e9bc9. This comment will update as new commits are pushed.

@dannykopping dannykopping force-pushed the dk/notification-prefs/admin-template-method branch from a38ce71 to b7c9ca8 Compare August 2, 2024 14:24
@dannykopping dannykopping force-pushed the dk/notification-prefs/db-audit branch from 2105aa4 to c4b8b31 Compare August 2, 2024 14:39
@dannykopping dannykopping force-pushed the dk/notification-prefs/admin-template-method branch from 4a0e0f2 to 8041cc7 Compare August 2, 2024 14:40
@dannykopping dannykopping force-pushed the dk/notification-prefs/db-audit branch 2 times, most recently from 6ea0336 to 2cc690c Compare August 5, 2024 08:00
@dannykopping dannykopping force-pushed the dk/notification-prefs/admin-template-method branch 4 times, most recently from 0386dab to 8bec5b1 Compare August 5, 2024 09:35
Comment on lines +56 to +58
dispatchMethod := s.defaultMethod
if metadata.CustomMethod.Valid {
dispatchMethod = metadata.CustomMethod.NotificationMethod
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is where the new dispatch method is chosen

@dannykopping dannykopping marked this pull request as ready for review August 5, 2024 09:53
@dannykopping dannykopping force-pushed the dk/notification-prefs/admin-template-method branch 2 times, most recently from f2926a3 to b3679fe Compare August 5, 2024 11:51
Signed-off-by: Danny Kopping <[email protected]>
Signed-off-by: Danny Kopping <[email protected]>
Signed-off-by: Danny Kopping <[email protected]>
Signed-off-by: Danny Kopping <[email protected]>
Signed-off-by: Danny Kopping <[email protected]>
Signed-off-by: Danny Kopping <[email protected]>
Signed-off-by: Danny Kopping <[email protected]>
Signed-off-by: Danny Kopping <[email protected]>
Signed-off-by: Danny Kopping <[email protected]>
Signed-off-by: Danny Kopping <[email protected]>
Signed-off-by: Danny Kopping <[email protected]>
Signed-off-by: Danny Kopping <[email protected]>
@dannykopping dannykopping force-pushed the dk/notification-prefs/admin-template-method branch from b3679fe to d627fef Compare August 5, 2024 11:54
@dannykopping dannykopping force-pushed the dk/notification-prefs/db-audit branch from 2cc690c to c744d33 Compare August 5, 2024 11:54
@dannykopping dannykopping merged commit e4103c3 into dk/notification-prefs/db-audit Aug 5, 2024
31 checks passed
@dannykopping dannykopping deleted the dk/notification-prefs/admin-template-method branch August 5, 2024 13:32
@github-actions github-actions bot locked and limited conversation to collaborators Aug 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enterprise Enterprise-license / premium functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants