From bdff3d7b5c579590ae2b946ae12b95311498f63b Mon Sep 17 00:00:00 2001 From: Sanne de Vries <65487235+sanne-san@users.noreply.github.com> Date: Thu, 8 Aug 2024 14:36:43 +0200 Subject: [PATCH] Updated paid cancellation notification email design (#20726) REF DES-572 --- .../email-templates/new-paid-cancellation.hbs | 118 ++++++++---------- .../staff-service/test/staff-service.test.js | 26 +--- 2 files changed, 56 insertions(+), 88 deletions(-) diff --git a/ghost/staff-service/lib/email-templates/new-paid-cancellation.hbs b/ghost/staff-service/lib/email-templates/new-paid-cancellation.hbs index 3a44cff119..f9a33bbfe1 100644 --- a/ghost/staff-service/lib/email-templates/new-paid-cancellation.hbs +++ b/ghost/staff-service/lib/email-templates/new-paid-cancellation.hbs @@ -30,71 +30,49 @@ + {{#if siteIconUrl}} + + + + {{/if}}
{{siteTitle}}
-

Hey there,

-

A paid member's subscription has just been canceled.

- - - - - - - - - - - - - {{#if subscriptionData.cancellationReason}} - - - - {{/if}} - -
- - - - - -
-
- {{memberData.initials}} -
-
-

{{memberData.name}}

- {{#if memberData.showEmail}} - - {{/if}} - {{#unless subscriptionData.cancelNow}} -

Canceled on {{subscriptionData.canceledAt}}

- {{/unless}} -
-
-
-

Tier

-

{{tierData.name}} - {{tierData.details}}

-
- {{#if subscriptionData.cancelNow}} -

Subscription expired on

- {{else}} -

Subscription will expire on

- {{/if}} -

{{subscriptionData.expiryAt}}

-
-

Cancellation reason

-

{{subscriptionData.cancellationReason}}

-
- - +

A paid member's subscription has just been canceled

+
- - - diff --git a/ghost/staff-service/test/staff-service.test.js b/ghost/staff-service/test/staff-service.test.js index 9540897a69..7570986cd2 100644 --- a/ghost/staff-service/test/staff-service.test.js +++ b/ghost/staff-service/test/staff-service.test.js @@ -732,13 +732,9 @@ describe('StaffService', function () { mailStub.calledOnce.should.be.true(); testCommonPaidSubCancelMailData(stubs); - mailStub.calledWith( - sinon.match.has('html', sinon.match('Canceled on 5 Aug 2022')) - ).should.be.true(); - // Expiration sentence is in the future tense mailStub.calledWith( - sinon.match.has('html', sinon.match('Subscription will expire on')) + sinon.match.has('html', sinon.match('Expires on')) ).should.be.true(); mailStub.calledWith( @@ -752,24 +748,17 @@ describe('StaffService', function () { mailStub.calledWith( sinon.match.has('html', sinon.match('Reason: Changed my mind!')) ).should.be.true(); - mailStub.calledWith( - sinon.match.has('html', sinon.match('Cancellation reason')) - ).should.be.true(); }); it('sends paid subscription cancel alert when sub is canceled without reason', async function () { - await service.emails.notifyPaidSubscriptionCanceled({member, tier, subscription, expiryAt, canceledAt, cancelNow}, options); + await service.emails.notifyPaidSubscriptionCanceled({member, tier, subscription, expiryAt, cancelNow}, options); mailStub.calledOnce.should.be.true(); testCommonPaidSubCancelMailData(stubs); - mailStub.calledWith( - sinon.match.has('html', sinon.match('Canceled on 5 Aug 2022')) - ).should.be.true(); - // Expiration sentence is in the future tense mailStub.calledWith( - sinon.match.has('html', sinon.match('Subscription will expire on')) + sinon.match.has('html', sinon.match('Expires on')) ).should.be.true(); mailStub.calledWith( @@ -780,9 +769,6 @@ describe('StaffService', function () { mailStub.calledWith( sinon.match.has('html', sinon.match('Reason: ')) ).should.be.false(); - mailStub.calledWith( - sinon.match.has('html', sinon.match('Cancellation reason')) - ).should.be.false(); }); it('sends paid subscription cancel alert when subscription is canceled immediately', async function () { @@ -802,7 +788,7 @@ describe('StaffService', function () { // Expiration sentence is in the past tense mailStub.calledWith( - sinon.match.has('html', sinon.match('Subscription expired on')) + sinon.match.has('html', sinon.match('Expired on')) ).should.be.true(); mailStub.calledWith( @@ -813,10 +799,6 @@ describe('StaffService', function () { sinon.match.has('html', 'Offer') ).should.be.false(); - mailStub.calledWith( - sinon.match.has('html', sinon.match('Cancellation reason')) - ).should.be.true(); - mailStub.calledWith( sinon.match.has('html', sinon.match('Reason: Payment failed')) ).should.be.true();
- +
+ + + + +
+

Name:

+ +

Tier:

+ + {{#if subscriptionData.cancelNow}} +

Expired on:

+ {{else}} +

Expires on:

+ {{/if}} + + {{#if subscriptionData.cancellationReason}} +

"{{subscriptionData.cancellationReason}}"

+ {{/if}} +
+ - +
View member + + + + + + +
View member
+
@@ -102,21 +80,29 @@
-
-

You can also copy & paste this URL into your browser:

- + + + + + + + +
+

Or copy and paste this URL into your browser:

+ +
-

This message was sent from {{siteDomain}} to {{toEmail}}

+
+

This message was sent from {{siteDomain}} to {{toEmail}}

-

Don’t want to receive these emails? Manage your preferences here.

+
+

Don’t want to receive these emails? Manage your preferences here.