Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes missing list items on opt-in confirmation page #903

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ frontend/.cache/
frontend/yarn.lock
frontend/build/
.vscode/
.idea/

config.toml
node_modules
listmonk
listmonk*
cmd/listmonk*
dist/*
5 changes: 4 additions & 1 deletion cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,9 @@ func initNotifTemplates(path string, fs stuffbin.FileSystem, i *i18n.I18n, cs *c
"L": func() *i18n.I18n {
return i
},
"safe": func(s string) template.HTML {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's rename this to Safe (uppercase S) to be consistent with the other exported functions.

return template.HTML(s)
},
}

tpls, err := stuffbin.ParseTemplatesGlob(funcs, fs, "/static/email-templates/*.html")
Expand All @@ -612,7 +615,7 @@ func initNotifTemplates(path string, fs stuffbin.FileSystem, i *i18n.I18n, cs *c
h := make([]byte, ln)
copy(h, html[0:ln])

if !bytes.Contains(bytes.ToLower(h), []byte("<!doctype html>")) {
if !bytes.Contains(bytes.ToLower(h), []byte("<!doctype html")) {
out.contentType = models.CampaignContentTypePlain
lo.Println("system e-mail templates are plaintext")
}
Expand Down
5 changes: 3 additions & 2 deletions cmd/public.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,15 @@ func handleOptinPage(c echo.Context) error {
}

// Get the list of subscription lists where the subscriber hasn't confirmed.
lists, err := app.core.GetSubscriberLists(0, subUUID, nil, out.ListUUIDs, models.SubscriptionStatusUnconfirmed, "")
var err error
out.Lists, err = app.core.GetSubscriberLists(0, subUUID, nil, out.ListUUIDs, models.SubscriptionStatusUnconfirmed, "")
if err != nil {
return c.Render(http.StatusInternalServerError, tplMessage,
makeMsgTpl(app.i18n.T("public.errorTitle"), "", app.i18n.Ts("public.errorFetchingLists")))
}

// There are no lists to confirm.
if len(lists) == 0 {
if len(out.Lists) == 0 {
return c.Render(http.StatusOK, tplMessage,
makeMsgTpl(app.i18n.T("public.noSubTitle"), "", app.i18n.Ts("public.noSubInfo")))
}
Expand Down
3 changes: 2 additions & 1 deletion i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"analytics.invalidDates": "Ungültiges Datum in `von` oder `bis`.",
"analytics.isUnique": "Statistiken können Abonnenten zugeordnet werden.",
"analytics.links": "Verweise",
"analytics.links": "Verweise",
"analytics.nonUnique": "Statistiken sind anonym, da Einzelabonnenten Tracking abgeschaltet ist.",
"analytics.title": "Statistiken",
"analytics.toDate": "Bis",
Expand Down Expand Up @@ -275,7 +276,7 @@
"public.campaignNotFound": "Die E-Mail wurde nicht gefunden.",
"public.confirmOptinSubTitle": "Abonnement bestätigen",
"public.confirmSub": "Abonnement bestätigen",
"public.confirmSubInfo": "Du hast dich für folgenden Listen angemeldet:",
"public.confirmSubInfo": "Du hast dich für folgende Listen angemeldet:",
"public.confirmSubTitle": "Bestätigen",
"public.dataRemoved": "Deine Anmeldung und alle Daten wurden entfernt.",
"public.dataRemovedTitle": "Daten gelöscht",
Expand Down