UpdateNotificationTemplateMethod modifies a notification template to use a specific notification method, overriding the method set in the deployment configuration.
(ctx context.Context, notificationTemplateID uuid.UUID, method string)
| 76 | // UpdateNotificationTemplateMethod modifies a notification template to use a specific notification method, overriding |
| 77 | // the method set in the deployment configuration. |
| 78 | func (c *Client) UpdateNotificationTemplateMethod(ctx context.Context, notificationTemplateID uuid.UUID, method string) error { |
| 79 | res, err := c.Request(ctx, http.MethodPut, |
| 80 | fmt.Sprintf("/api/v2/notifications/templates/%s/method", notificationTemplateID), |
| 81 | UpdateNotificationTemplateMethod{Method: method}, |
| 82 | ) |
| 83 | if err != nil { |
| 84 | return err |
| 85 | } |
| 86 | defer res.Body.Close() |
| 87 | |
| 88 | if res.StatusCode == http.StatusNotModified { |
| 89 | return nil |
| 90 | } |
| 91 | if res.StatusCode != http.StatusOK { |
| 92 | return ReadBodyAsError(res) |
| 93 | } |
| 94 | return nil |
| 95 | } |
| 96 | |
| 97 | // GetSystemNotificationTemplates retrieves all notification templates pertaining to internal system events. |
| 98 | func (c *Client) GetSystemNotificationTemplates(ctx context.Context) ([]NotificationTemplate, error) { |