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:
parent
eb930b0794
commit
ee4581ed7e
1 changed files with 5 additions and 3 deletions
|
|
@ -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)
|
||||||
|
go func() {
|
||||||
if err := email.SendEmail(e); err != nil {
|
if err := email.SendEmail(e); err != nil {
|
||||||
log.Default().Printf("ERROR sending GM notification: %s", err)
|
log.Default().Printf("ERROR sending GM notification: %s", err)
|
||||||
}
|
}
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue