From 5b16fc26dffa6a324c4cd800e83793bce73f054f Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Mon, 20 Apr 2026 22:35:47 -0600 Subject: [PATCH] feat(formmailer): log successful send for observability --- cmd/form2mail/.gitignore | 1 + net/formmailer/formmailer.go | 1 + 2 files changed, 2 insertions(+) diff --git a/cmd/form2mail/.gitignore b/cmd/form2mail/.gitignore index b5a38fe..1a8843b 100644 --- a/cmd/form2mail/.gitignore +++ b/cmd/form2mail/.gitignore @@ -1 +1,2 @@ /form2mail +/form2mail-* diff --git a/net/formmailer/formmailer.go b/net/formmailer/formmailer.go index 05c4c1e..f610046 100644 --- a/net/formmailer/formmailer.go +++ b/net/formmailer/formmailer.go @@ -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())