fix: apply code-review and insight findings across nuntius

This commit is contained in:
2026-07-26 20:40:16 +02:00
parent 6339771a24
commit 83c95dff08
8 changed files with 94 additions and 18 deletions
+7 -2
View File
@@ -198,14 +198,19 @@ func compose(from, to string, req contactform.Request, formName, formType string
case "generic":
tmpl = emailTemplateGeneric
}
_ = tmpl.Execute(&htmlBuf, map[string]string{
if err := tmpl.Execute(&htmlBuf, map[string]string{
"FormName": formName,
"Name": req.Name,
"Email": req.Email,
"Service": req.Service,
"Message": req.Message,
"Received": received,
})
}); err != nil {
// template.Must guarantees valid templates; this path is
// unreachable in normal operation.
htmlBuf.Reset()
fmt.Fprintf(&htmlBuf, "<p>Email generation error: %v</p>", err)
}
// --- Subject + plain-text body per form type ---
var subject, text string