diff --git a/flow/alerting/alerting.go b/flow/alerting/alerting.go index 6dcbc85409..fe6c8a102d 100644 --- a/flow/alerting/alerting.go +++ b/flow/alerting/alerting.go @@ -52,10 +52,15 @@ func (a *Alerter) registerSendersFromPool(ctx context.Context) ([]AlertSenderCon alertSenderConfigs = append(alertSenderConfigs, AlertSenderConfig{Id: id, Sender: newSlackAlertSender(&slackServiceConfig)}) case EMAIL: + var replyToAddresses []string + if envReplyToAddresses := strings.Split(peerdbenv.PeerDBAlertingEmailSenderReplyToAddresses(), ","); len(envReplyToAddresses) != 0 { + // AWS SDK does not like empty slice + replyToAddresses = envReplyToAddresses + } emailServiceConfig := EmailAlertSenderConfig{ sourceEmail: peerdbenv.PeerDBAlertingEmailSenderSourceEmail(), configurationSetName: peerdbenv.PeerDBAlertingEmailSenderConfigurationSet(), - replyToAddresses: strings.Split(peerdbenv.PeerDBAlertingEmailSenderReplyToAddresses(), ","), + replyToAddresses: replyToAddresses, } if emailServiceConfig.sourceEmail == "" { return errors.New("missing sourceEmail for Email alerting service")