Send GM notification email asynchronously

Page response no longer waits on SMTP — status update persists and
returns immediately; email fires in a background goroutine.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Harry Culpan 2026-06-30 20:41:24 -04:00
parent eb930b0794
commit ee4581ed7e

View file

@ -167,9 +167,11 @@ func updatePlayerAttending(name, attending string, session data.Session) error {
if gmEmail := session.GMEmail(); gmEmail != "" { if gmEmail := session.GMEmail(); gmEmail != "" {
subject, body := session.FormatStatusUpdate(name, newAttending, "the site") subject, body := session.FormatStatusUpdate(name, newAttending, "the site")
e := email.NewEmail([]string{gmEmail}, []string{}, gmEmail, subject, body) e := email.NewEmail([]string{gmEmail}, []string{}, gmEmail, subject, body)
if err := email.SendEmail(e); err != nil { go func() {
log.Default().Printf("ERROR sending GM notification: %s", err) if err := email.SendEmail(e); err != nil {
} log.Default().Printf("ERROR sending GM notification: %s", err)
}
}()
} }
return nil return nil
} }