mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: allow notification templates to be disabled by default (#16093)
Change as part of https://github.com/coder/coder/pull/16071 It has been decided that we want to be able to have some notification templates be disabled _by default_ https://github.com/coder/coder/pull/16071#issuecomment-2580757061. This adds a new column (`enabled_by_default`) to `notification_templates` that defaults to `TRUE`. It also modifies the `inhibit_enqueue_if_disabled` function to reject notifications for templates that have `enabled_by_default = FALSE` with the user not explicitly enabling it.
This commit is contained in:
@@ -2480,8 +2480,9 @@ type NotificationTemplate struct {
|
||||
Actions []byte `db:"actions" json:"actions"`
|
||||
Group sql.NullString `db:"group" json:"group"`
|
||||
// NULL defers to the deployment-level method
|
||||
Method NullNotificationMethod `db:"method" json:"method"`
|
||||
Kind NotificationTemplateKind `db:"kind" json:"kind"`
|
||||
Method NullNotificationMethod `db:"method" json:"method"`
|
||||
Kind NotificationTemplateKind `db:"kind" json:"kind"`
|
||||
EnabledByDefault bool `db:"enabled_by_default" json:"enabled_by_default"`
|
||||
}
|
||||
|
||||
// A table used to configure apps that can use Coder as an OAuth2 provider, the reverse of what we are calling external authentication.
|
||||
|
||||
Reference in New Issue
Block a user