mirror of
https://github.com/therootcompany/golib.git
synced 2026-11-04 06:55:00 +00:00
feat(formmailer): log successful send for observability
This commit is contained in:
parent
6a85a93605
commit
5b16fc26df
1
cmd/form2mail/.gitignore
vendored
1
cmd/form2mail/.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
/form2mail
|
/form2mail
|
||||||
|
/form2mail-*
|
||||||
|
|||||||
@ -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)
|
http.Error(w, "failed to send — please try again later", http.StatusInternalServerError)
|
||||||
return
|
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.Header().Set("Content-Type", fm.contentType())
|
||||||
_, _ = w.Write(fm.successBody())
|
_, _ = w.Write(fm.successBody())
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user