fix: apply code-review and insight findings across nuntius
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user