Skip to content

High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.

Exclude opt-in campaign from public archive.

Kailash Nadheac12404373b
diff --git a/cmd/archive.go b/cmd/archive.go
index d0c5094a..d2fdf75e 100644
--- a/cmd/archive.go
+++ b/cmd/archive.go
@@ -77,12 +77,19 @@ func handleCampaignArchivePage(c echo.Context) error {
)
pubCamp, err := app.core.GetArchivedCampaign(0, uuid)
- if err != nil {
+ if err != nil || pubCamp.Type != models.CampaignTypeRegular {
+ notFound := false
if er, ok := err.(*echo.HTTPError); ok {
if er.Code == http.StatusBadRequest {
- return c.Render(http.StatusNotFound, tplMessage,
- makeMsgTpl(app.i18n.T("public.notFoundTitle"), "", app.i18n.T("public.campaignNotFound")))
+ notFound = true
}
+ } else if pubCamp.Type != models.CampaignTypeRegular {
+ notFound = true
+ }
+
+ if notFound {
+ return c.Render(http.StatusNotFound, tplMessage,
+ makeMsgTpl(app.i18n.T("public.notFoundTitle"), "", app.i18n.T("public.campaignNotFound")))
}
return c.Render(http.StatusInternalServerError, tplMessage,