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:
2025-10-22 23:31:32 -07:00
parent 8229944149
commit 35b6c8aed3
12 changed files with 444 additions and 39 deletions
+3 -3
View File
@@ -97,7 +97,7 @@ func main() {
logger.Infof("Supported notification types: %v", factory.SupportedTypes())
// Create notification service (pass config as account resolver)
svc := service.NewNotificationService(factory, q, cfg.Queue.WorkerCount, cfg)
svc := service.NewNotificationService(factory, q, cfg.Queue.WorkerCount, cfg, logger)
// Start workers
if err := svc.Start(ctx); err != nil {
@@ -228,7 +228,7 @@ func startGRPCServer(ctx context.Context, wg *sync.WaitGroup, cfg *config.Config
grpcServer := grpc.NewServer()
// Create and register gRPC handler
grpcHandler := grpcapi.NewNotifierHandler(svc)
grpcHandler := grpcapi.NewNotifierHandler(svc, logger)
pb.RegisterNotifierServiceServer(grpcServer, grpcHandler)
// Enable reflection for tools like grpcurl
@@ -248,7 +248,7 @@ func startGRPCServer(ctx context.Context, wg *sync.WaitGroup, cfg *config.Config
}
func startRESTServer(ctx context.Context, wg *sync.WaitGroup, cfg *config.Config, svc domain.NotificationService, logger *logging.Logger) *http.Server {
router := rest.NewRouter(svc)
router := rest.NewRouter(svc, logger)
addr := fmt.Sprintf("%s:%d", cfg.Server.Host, cfg.Server.RESTPort)
server := &http.Server{