Fixed subject line and css

This commit is contained in:
h202-wq
2026-07-09 15:44:33 -04:00
parent 17036ee789
commit 45771164d0
3 changed files with 59 additions and 21 deletions
+14 -1
View File
@@ -895,8 +895,21 @@ func makeOptinNotifyHook(unsubHeader bool, u *UrlConfig, q *models.Queries, i *i
hdr.Set("List-Unsubscribe", `<`+unsubURL+`>`)
}
// Build the subject with public list names. Private list names are
// not leaked in the subject, mirroring the e-mail body.
var pubNames []string
for _, l := range out.Lists {
if l.Type == models.ListTypePublic {
pubNames = append(pubNames, l.Name)
}
}
subject := i.T("subscribers.optinSubject")
if len(pubNames) > 0 {
subject = i.Ts("subscribers.optinSubjectList", "name", strings.Join(pubNames, ", "))
}
// Send the e-mail.
if err := notifs.Notify([]string{sub.Email}, i.T("subscribers.optinSubject"), notifs.TplSubscriberOptin, out, hdr); err != nil {
if err := notifs.Notify([]string{sub.Email}, subject, notifs.TplSubscriberOptin, out, hdr); err != nil {
lo.Printf("error sending opt-in e-mail for subscriber %d (%s): %s", sub.ID, sub.UUID, err)
return 0, err
}