diff --git a/flow/alerting/alerting.go b/flow/alerting/alerting.go index b62e34df92..ad29be6c76 100644 --- a/flow/alerting/alerting.go +++ b/flow/alerting/alerting.go @@ -52,10 +52,14 @@ func (a *Alerter) registerSendersFromPool(ctx context.Context) ([]AlertSenderCon alertSenderConfigs = append(alertSenderConfigs, AlertSenderConfig{Id: id, Sender: newSlackAlertSender(&slackServiceConfig)}) case EMAIL: + var replyToAddresses []string + if envString := strings.TrimSpace(peerdbenv.PeerDBAlertingEmailSenderReplyToAddresses()); len(envString) != 0 { + replyToAddresses = strings.Split(envString, ",") + } 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") diff --git a/flow/alerting/email_alert_sender.go b/flow/alerting/email_alert_sender.go index 2862a3fb59..2a534318c0 100644 --- a/flow/alerting/email_alert_sender.go +++ b/flow/alerting/email_alert_sender.go @@ -83,15 +83,11 @@ func NewEmailAlertSenderWithNewClient(ctx context.Context, region *string, confi } func NewEmailAlertSender(client *ses.Client, config *EmailAlertSenderConfig) *EmailAlertSender { - replyToAddresses := config.replyToAddresses - if len(replyToAddresses) == 0 { - replyToAddresses = []string{config.sourceEmail} - } return &EmailAlertSender{ client: client, sourceEmail: config.sourceEmail, configurationSetName: config.configurationSetName, - replyToAddresses: replyToAddresses, + replyToAddresses: config.replyToAddresses, slotLagMBAlertThreshold: config.SlotLagMBAlertThreshold, openConnectionsAlertThreshold: config.OpenConnectionsAlertThreshold, emailAddresses: config.EmailAddresses,