Skip to content

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

Make public subscription API follow the 'enable public' setting.

Kailash Nadha6a2b6982036
diff --git a/cmd/public.go b/cmd/public.go
index 7816ca31..ff8e6dc5 100644
--- a/cmd/public.go
+++ b/cmd/public.go
@@ -482,6 +482,14 @@ func handleSubscriptionForm(c echo.Context) error {
// handlePublicSubscription handles subscription requests coming from public
// API calls.
func handlePublicSubscription(c echo.Context) error {
+ var (
+ app = c.Get("app").(*App)
+ )
+
+ if !app.constants.EnablePublicSubPage {
+ return echo.NewHTTPError(http.StatusBadRequest, app.i18n.T("public.invalidFeature"))
+ }
+
hasOptin, err := processSubForm(c)
if err != nil {
return err