Skip to content

Commit

Permalink
fix: empty reply to address from env
Browse files Browse the repository at this point in the history
  • Loading branch information
iamKunalGupta committed Mar 12, 2024
1 parent f4a3968 commit 25c6777
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion flow/alerting/alerting.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 25c6777

Please sign in to comment.