From 7a7b473f898b05b5d7f4173065bd1c5d0f67235a Mon Sep 17 00:00:00 2001 From: Sanne de Vries Date: Thu, 27 Jan 2022 21:40:30 +0000 Subject: [PATCH] Updated Email newsletter settings No issue - When disabling email newsletters, the "Subscribed to email" toggle in the member profile is hidden - Copy changes to the Default newsletter recipients setting - Moved tiers to the top of the segment selection in Default newsletter recipients --- .../components/gh-member-settings-form.hbs | 30 +++++++------ .../components/gh-members-segment-select.js | 43 ++++++++++--------- .../default-recipients-select.js | 4 +- 3 files changed, 40 insertions(+), 37 deletions(-) diff --git a/ghost/admin/app/components/gh-member-settings-form.hbs b/ghost/admin/app/components/gh-member-settings-form.hbs index 2d03c1c02e..eb02b00c49 100644 --- a/ghost/admin/app/components/gh-member-settings-form.hbs +++ b/ghost/admin/app/components/gh-member-settings-form.hbs @@ -43,21 +43,23 @@ {{gh-count-down-characters this.scratchMember.note 500}}

- -
-
-

Subscribed to newsletter

-

If disabled, member will not receive newsletter emails

+ {{#if (not-eq this.settings.editorDefaultEmailRecipients "disabled")}} + +
+
+

Subscribed to newsletter

+

If disabled, member will not receive newsletter emails

+
+
+ +
-
- -
-
- + + {{/if}}
diff --git a/ghost/admin/app/components/gh-members-segment-select.js b/ghost/admin/app/components/gh-members-segment-select.js index 587224944e..01c8b7f9e7 100644 --- a/ghost/admin/app/components/gh-members-segment-select.js +++ b/ghost/admin/app/components/gh-members-segment-select.js @@ -73,27 +73,6 @@ export default class GhMembersSegmentSelect extends Component { }); } - // fetch all labels w̶i̶t̶h̶ c̶o̶u̶n̶t̶s̶ - // TODO: add `include: 'count.members` to query once API is fixed - const labels = yield this.store.query('label', {limit: 'all'}); - - if (labels.length > 0 && !this.args.hideLabels) { - const labelsGroup = { - groupName: 'Labels', - options: [] - }; - - labels.forEach((label) => { - labelsGroup.options.push({ - name: label.name, - segment: `label:${label.slug}`, - count: label.count?.members, - class: 'segment-label' - }); - }); - - options.push(labelsGroup); - } if (this.feature.get('multipleProducts')) { // fetch all products w̶i̶t̶h̶ c̶o̶u̶n̶t̶s̶ // TODO: add `include: 'count.members` to query once API supports @@ -121,6 +100,28 @@ export default class GhMembersSegmentSelect extends Component { } } + // fetch all labels w̶i̶t̶h̶ c̶o̶u̶n̶t̶s̶ + // TODO: add `include: 'count.members` to query once API is fixed + const labels = yield this.store.query('label', {limit: 'all'}); + + if (labels.length > 0 && !this.args.hideLabels) { + const labelsGroup = { + groupName: 'Labels', + options: [] + }; + + labels.forEach((label) => { + labelsGroup.options.push({ + name: label.name, + segment: `label:${label.slug}`, + count: label.count?.members, + class: 'segment-label' + }); + }); + + options.push(labelsGroup); + } + this._options = options; } } diff --git a/ghost/admin/app/components/settings/members-email/default-recipients-select.js b/ghost/admin/app/components/settings/members-email/default-recipients-select.js index 91bce31848..67cd01c08c 100644 --- a/ghost/admin/app/components/settings/members-email/default-recipients-select.js +++ b/ghost/admin/app/components/settings/members-email/default-recipients-select.js @@ -22,8 +22,8 @@ export default class SettingsDefaultEmailRecipientsComponent extends Component { icon: 'members-paid', icon_color: 'pink' }, { - name: 'Specific tier(s)', - description: 'Only people who have a subscription to a selected tier', + name: 'Specific people', + description: 'Only people with any of the selected tiers or labels', value: 'segment', icon: 'members-segment', icon_color: 'yellow'