diff --git a/ghost/admin/app/controllers/settings/staff/user.js b/ghost/admin/app/controllers/settings/staff/user.js index 3db3c9c615..8698e7cbfe 100644 --- a/ghost/admin/app/controllers/settings/staff/user.js +++ b/ghost/admin/app/controllers/settings/staff/user.js @@ -216,6 +216,11 @@ export default class UserController extends Controller { this.user.mentionNotifications = event.target.checked; } + @action + toggleMilestoneNotifications(event) { + this.user.milestoneNotifications = event.target.checked; + } + @action toggleMemberEmailAlerts(type, event) { if (type === 'free-signup') { diff --git a/ghost/admin/app/models/user.js b/ghost/admin/app/models/user.js index 0d222c158d..07cf77fe30 100644 --- a/ghost/admin/app/models/user.js +++ b/ghost/admin/app/models/user.js @@ -41,6 +41,7 @@ export default BaseModel.extend(ValidationEngine, { paidSubscriptionStartedNotification: attr(), paidSubscriptionCanceledNotification: attr(), mentionNotifications: attr(), + milestoneNotifications: attr(), ghostPaths: service(), ajax: service(), session: service(), diff --git a/ghost/admin/app/templates/settings/staff/user.hbs b/ghost/admin/app/templates/settings/staff/user.hbs index 1241663089..98b69b6e0f 100644 --- a/ghost/admin/app/templates/settings/staff/user.hbs +++ b/ghost/admin/app/templates/settings/staff/user.hbs @@ -346,6 +346,27 @@ {{/if}} + {{#if (feature 'milestoneEmails') }} +
+
+ +

Occasional summaries of your audience & revenue growth

+
+
+ +
+
+ {{/if}} {{/if}} {{/if}} diff --git a/ghost/admin/tests/acceptance/staff-test.js b/ghost/admin/tests/acceptance/staff-test.js index f38a1c9f87..f6d3667946 100644 --- a/ghost/admin/tests/acceptance/staff-test.js +++ b/ghost/admin/tests/acceptance/staff-test.js @@ -82,6 +82,7 @@ describe('Acceptance: Staff', function () { enableStripe(this.server); enableLabsFlag(this.server, 'webmentions'); enableLabsFlag(this.server, 'webmentionEmails'); + enableLabsFlag(this.server, 'milestoneEmails'); admin = this.server.create('user', {email: 'admin@example.com', roles: [adminRole]}); @@ -873,11 +874,13 @@ describe('Acceptance: Staff', function () { expect(find('[data-test-checkbox="paid-started-notifications"]')).to.not.be.checked; expect(find('[data-test-checkbox="paid-canceled-notifications"]')).to.not.be.checked; expect(find('[data-test-checkbox="mention-notifications"]')).to.not.be.checked; + expect(find('[data-test-checkbox="milestone-notifications"]')).to.not.be.checked; await click('[data-test-label="free-signup-notifications"]'); await click('[data-test-label="paid-started-notifications"]'); await click('[data-test-label="paid-canceled-notifications"]'); await click('[data-test-label="mention-notifications"]'); + await click('[data-test-label="milestone-notifications"]'); await click('[data-test-save-button]'); await visit(`/settings/staff/${admin.slug}`); @@ -886,6 +889,7 @@ describe('Acceptance: Staff', function () { expect(find('[data-test-checkbox="paid-started-notifications"]')).to.be.checked; expect(find('[data-test-checkbox="paid-canceled-notifications"]')).to.be.checked; expect(find('[data-test-checkbox="mention-notifications"]')).to.be.checked; + expect(find('[data-test-checkbox="milestone-notifications"]')).to.be.checked; }); });