feat(formmailer): log successful send for observability

This commit is contained in:
AJ ONeal 2026-04-20 22:35:47 -06:00
parent 6a85a93605
commit 5b16fc26df
No known key found for this signature in database
2 changed files with 2 additions and 0 deletions

View File

@ -1 +1,2 @@
/form2mail
/form2mail-*

View File

@ -347,6 +347,7 @@ func (fm *FormMailer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
http.Error(w, "failed to send — please try again later", http.StatusInternalServerError)
return
}
log.Printf("contact form: sent ip=%s from=%q to=%s", ipStr, email, strings.Join(fm.SMTPTo, ","))
w.Header().Set("Content-Type", fm.contentType())
_, _ = w.Write(fm.successBody())