Log error when sendEmailHandler fails to send an email
Send Reminder failures were silently swallowed, only surfacing in the HTTP response and never in the application log, unlike the GM notification email flows. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
ee4581ed7e
commit
5f1a48b1be
1 changed files with 2 additions and 0 deletions
|
|
@ -2,6 +2,7 @@ package main
|
|||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
|
|
@ -29,6 +30,7 @@ func sendEmailHandler(w http.ResponseWriter, r *http.Request) {
|
|||
// log.Default().Printf("got email: To: %s, From: %s, Subject: %q, Body: %q", to, from, subject, body)
|
||||
err := email.SendEmail(e)
|
||||
if err != nil {
|
||||
log.Default().Printf("ERROR sending email: %s", err)
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue