Skip to content

Commit

Permalink
fix: incorrect categories reference
Browse files Browse the repository at this point in the history
  • Loading branch information
rapatao committed Nov 4, 2024
1 parent 923edf3 commit fc3af38
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/sendgrid/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ func (s *Service) triggerDeliveryEvent(ctx context.Context, message model.Messag
event["sg_event_id"] = message.EventID
event["sg_message_id"] = message.MessageID
event["smtp-id"] = message.EventID + "." + message.MessageID + "@mock"
event["category"] = categories
event["category"] = message.Categories

s.sendEvent(ctx, event)
}

func (s *Service) sendEvent(ctx context.Context, event map[string]any) {
func (s *Service) sendEvent(ctx context.Context, events ...map[string]any) {
if !s.config.Event {
return
}

body, err := json.Marshal([]map[string]any{event})
body, err := json.Marshal(events)
if err != nil {
log.Error().Err(err).Msg("failed to marshal events")

Expand Down

0 comments on commit fc3af38

Please sign in to comment.