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:
Harry Culpan 2026-07-04 21:33:09 -04:00
parent ee4581ed7e
commit 5f1a48b1be

View file

@ -2,6 +2,7 @@ package main
import ( import (
"context" "context"
"log"
"net/http" "net/http"
"strings" "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) // log.Default().Printf("got email: To: %s, From: %s, Subject: %q, Body: %q", to, from, subject, body)
err := email.SendEmail(e) err := email.SendEmail(e)
if err != nil { if err != nil {
log.Default().Printf("ERROR sending email: %s", err)
http.Error(w, err.Error(), http.StatusInternalServerError) http.Error(w, err.Error(), http.StatusInternalServerError)
return return
} }