Skip to content

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

Fix private lists being unsubscribed from public form and re-factor subscription status view in admin.

Kailash Nadh1164afac5e9c
diff --git a/cmd/public.go b/cmd/public.go
index 044e0aaf..7816ca31 100644
--- a/cmd/public.go
+++ b/cmd/public.go
@@ -302,18 +302,22 @@ func handleSubscriptionPrefs(c echo.Context) error {
// Get the subscriber's lists and whatever is not sent in the request (unchecked),
// unsubscribe them.
- subs, err := app.core.GetSubscriptions(0, subUUID, false)
- if err != nil {
- return echo.NewHTTPError(http.StatusBadRequest, app.i18n.T("public.errorFetchingLists"))
- }
reqUUIDs := make(map[string]struct{})
for _, u := range req.ListUUIDs {
reqUUIDs[u] = struct{}{}
}
+ subs, err := app.core.GetSubscriptions(0, subUUID, false)
+ if err != nil {
+ return echo.NewHTTPError(http.StatusBadRequest, app.i18n.T("public.errorFetchingLists"))
+ }
+
unsubUUIDs := make([]string, 0, len(req.ListUUIDs))
for _, s := range subs {
- if _, ok := reqUUIDs[s.UUID]; ok {
+ if s.Type == models.ListTypePrivate {
+ continue
+ }
+ if _, ok := reqUUIDs[s.UUID]; !ok {
unsubUUIDs = append(unsubUUIDs, s.UUID)
}
}
diff --git a/frontend/src/assets/style.scss b/frontend/src/assets/style.scss
index c2f56411..7f1e8cf9 100644
--- a/frontend/src/assets/style.scss
+++ b/frontend/src/assets/style.scss
@@ -560,14 +560,14 @@ body.is-noscroll {
border: 1px solid lighten($color, 42%);
box-shadow: 1px 1px 0 lighten($color, 42%);
}
- &.finished, &.enabled {
+ &.finished, &.enabled, &.status-confirmed {
$color: $green;
color: $color;
background: #f6ffed;
border: 1px solid lighten($color, 45%);
box-shadow: 1px 1px 0 lighten($color, 45%);
}
- &.blocklisted, &.cancelled {
+ &.blocklisted, &.cancelled, &.status-unsubscribed {
$color: $red;
color: $color;
background: #fff1f0;
@@ -591,6 +591,7 @@ body.is-noscroll {
}
}
+
/* Page header */
.page-header {
.buttons {
@@ -675,6 +676,10 @@ section.lists {
thead th, tbody td {
padding: 10px;
}
+
+ td.status .tag {
+ width: 100%;
+ }
}
.bounces {
diff --git a/frontend/src/views/SubscriberForm.vue b/frontend/src/views/SubscriberForm.vue
index 4f19cc28..025b25cc 100644
--- a/frontend/src/views/SubscriberForm.vue
+++ b/frontend/src/views/SubscriberForm.vue
@@ -94,17 +94,23 @@
</b-tag>{{ ' ' }}
</div>
</b-table-column>
- <b-table-column v-slot="props" field="status" :label="$t('globals.fields.status')">
- {{ props.row.optin === 'double' ? props.row.subscriptionStatus : '-' }}
+
+ <b-table-column v-slot="props" field="status" cell-class="status"
+ :label="$t('globals.fields.status')">
+ <b-tag :class="`status-${props.row.subscriptionStatus}`">
+ {{ $t(`subscribers.status.${props.row.subscriptionStatus}`) }}
+ </b-tag>
<template v-if="props.row.optin === 'double'
&& props.row.subscriptionMeta.optinIp">
<br /><span class="is-size-7">{{ props.row.subscriptionMeta.optinIp }}</span>
</template>
</b-table-column>
+
<b-table-column v-slot="props" field="createdAt"
:label="$t('globals.fields.createdAt')">
{{ $utils.niceDate(props.row.subscriptionCreatedAt, true) }}
</b-table-column>
+
<b-table-column v-slot="props" field="updatedAt"
:label="$t('globals.fields.updatedAt')">
{{ $utils.niceDate(props.row.subscriptionCreatedAt, true) }}