mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: implement thin vertical slice of system-generated notifications (#13537)
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
package types
|
||||
|
||||
type TemplateAction struct {
|
||||
Label string `json:"label"`
|
||||
URL string `json:"url"`
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package types
|
||||
|
||||
// MessagePayload describes the JSON payload to be stored alongside the notification message, which specifies all of its
|
||||
// metadata, labels, and routing information.
|
||||
//
|
||||
// Any BC-incompatible changes must bump the version, and special handling must be put in place to unmarshal multiple versions.
|
||||
type MessagePayload struct {
|
||||
Version string `json:"_version"`
|
||||
|
||||
NotificationName string `json:"notification_name"`
|
||||
CreatedBy string `json:"created_by"`
|
||||
|
||||
UserID string `json:"user_id"`
|
||||
UserEmail string `json:"user_email"`
|
||||
UserName string `json:"user_name"`
|
||||
|
||||
Actions []TemplateAction `json:"actions"`
|
||||
Labels map[string]string `json:"labels"`
|
||||
}
|
||||
Reference in New Issue
Block a user