Enhance notification APIs with HTML email support, CC/BCC, and structured logging
Add comprehensive improvements across REST and gRPC APIs: - Add structured logging for all notification operations - Implement HTML email support with multipart/alternative MIME - Add CC and BCC recipient support for email notifications - Add GetNotifiers endpoint to query available notifier configurations - Support configurable From name in SMTP configuration - Auto-detect content type (text vs HTML) in notification bodies - Improve error handling and validation across all endpoints 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -24,6 +24,14 @@ const (
|
||||
TypeStdout NotificationType = "stdout"
|
||||
)
|
||||
|
||||
// ContentType defines the format of the notification body
|
||||
type ContentType string
|
||||
|
||||
const (
|
||||
ContentTypeText ContentType = "text"
|
||||
ContentTypeHTML ContentType = "html"
|
||||
)
|
||||
|
||||
// NotificationStatus represents the current state of a notification
|
||||
type NotificationStatus string
|
||||
|
||||
@@ -60,9 +68,20 @@ type Notification struct {
|
||||
// Body is the main content of the notification
|
||||
Body string `json:"body"`
|
||||
|
||||
// ContentType specifies the format of the body (text or html)
|
||||
// Defaults to "text" if not specified. HTML is auto-detected if body starts with < or contains HTML tags.
|
||||
ContentType ContentType `json:"content_type,omitempty"`
|
||||
|
||||
// Recipients contains the target addresses (email, slack channel, ntfy topic, etc.)
|
||||
// For email: these are the "To" recipients
|
||||
Recipients []string `json:"recipients"`
|
||||
|
||||
// CC contains carbon copy recipients (email only, optional)
|
||||
CC []string `json:"cc,omitempty"`
|
||||
|
||||
// BCC contains blind carbon copy recipients (email only, optional)
|
||||
BCC []string `json:"bcc,omitempty"`
|
||||
|
||||
// Metadata contains additional provider-specific data
|
||||
Metadata map[string]interface{} `json:"metadata,omitempty"`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user