()
| 10 | ) |
| 11 | |
| 12 | func (r *RootCmd) notifications() *serpent.Command { |
| 13 | cmd := &serpent.Command{ |
| 14 | Use: "notifications", |
| 15 | Short: "Manage Coder notifications", |
| 16 | Long: "Administrators can use these commands to change notification settings.\n" + FormatExamples( |
| 17 | Example{ |
| 18 | Description: "Pause Coder notifications. Administrators can temporarily stop notifiers from dispatching messages in case of the target outage (for example: unavailable SMTP server or Webhook not responding)", |
| 19 | Command: "coder notifications pause", |
| 20 | }, |
| 21 | Example{ |
| 22 | Description: "Resume Coder notifications", |
| 23 | Command: "coder notifications resume", |
| 24 | }, |
| 25 | Example{ |
| 26 | Description: "Send a test notification. Administrators can use this to verify the notification target settings", |
| 27 | Command: "coder notifications test", |
| 28 | }, |
| 29 | Example{ |
| 30 | Description: "Send a custom notification to the requesting user. Sending notifications targeting other users or groups is currently not supported", |
| 31 | Command: "coder notifications custom \"Custom Title\" \"Custom Message\"", |
| 32 | }, |
| 33 | ), |
| 34 | Aliases: []string{"notification"}, |
| 35 | Handler: func(inv *serpent.Invocation) error { |
| 36 | return inv.Command.HelpHandler(inv) |
| 37 | }, |
| 38 | Children: []*serpent.Command{ |
| 39 | r.pauseNotifications(), |
| 40 | r.resumeNotifications(), |
| 41 | r.testNotifications(), |
| 42 | r.customNotifications(), |
| 43 | }, |
| 44 | } |
| 45 | return cmd |
| 46 | } |
| 47 | |
| 48 | func (r *RootCmd) pauseNotifications() *serpent.Command { |
| 49 | cmd := &serpent.Command{ |
no test coverage detected