feat: account dispute emails
This commit is contained in:
+6
-2
@@ -69,17 +69,21 @@ func perRender(hq, tone string) map[string]any {
|
||||
// The subject comes from the text set, not the HTML one: html/template would
|
||||
// escape an ampersand in an instance name into "&" and mail clients show
|
||||
// subjects verbatim.
|
||||
func render(name string, data any, hq string) (message, error) {
|
||||
func render(name string, data any, hq ...string) (message, error) {
|
||||
s, ok := sets[name]
|
||||
if !ok {
|
||||
return message{}, fmt.Errorf("no such template")
|
||||
}
|
||||
var hqURL string
|
||||
if len(hq) > 0 {
|
||||
hqURL = hq[0]
|
||||
}
|
||||
|
||||
var tone strings.Builder
|
||||
if err := s.text.ExecuteTemplate(&tone, "tone", data); err != nil {
|
||||
return message{}, err
|
||||
}
|
||||
per := perRender(hq, strings.TrimSpace(tone.String()))
|
||||
per := perRender(hqURL, strings.TrimSpace(tone.String()))
|
||||
|
||||
ht, err := s.html.Clone()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user