Update email.go

This commit is contained in:
MaximilianKohler 2025-02-16 18:24:39 -08:00 committed by GitHub
parent 02da11104d
commit 491a3db0dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -190,6 +190,19 @@ func (e *Emailer) Flush() error {
return nil
}
// Retrieve the retry delay from the configuration
retryDelay := time.Duration(config.RetryDelay) * time.Second
// Implement retry logic
var err error
for i := 0; i < maxRetries; i++ {
err = sendSMTPMail(...)
if err == nil {
break
}
time.Sleep(retryDelay) // Wait for the retry delay before the next attempt
}
// Close closes the SMTP pools.
func (e *Emailer) Close() error {
for _, s := range e.servers {