From fbac9689c916d802e6d3c1d6460a9638eab19901 Mon Sep 17 00:00:00 2001 From: Rishabh Date: Fri, 26 Aug 2022 01:48:47 +0530 Subject: [PATCH] Removed empty cancellation reason from alert template refs https://github.com/TryGhost/Team/issues/1826 --- .../lib/email-templates/new-paid-cancellation.hbs | 2 ++ ghost/staff-service/test/staff-service.test.js | 6 ++++++ 2 files changed, 8 insertions(+) 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 3c3fecb843..d6a72ca937 100644 --- a/ghost/staff-service/lib/email-templates/new-paid-cancellation.hbs +++ b/ghost/staff-service/lib/email-templates/new-paid-cancellation.hbs @@ -158,12 +158,14 @@

{{subscriptionData.expiryAt}}

+ {{#if subscriptionData.cancellationReason}}

Cancellation reason

{{subscriptionData.cancellationReason}}

+ {{/if}} diff --git a/ghost/staff-service/test/staff-service.test.js b/ghost/staff-service/test/staff-service.test.js index 81de8f189a..979da4c229 100644 --- a/ghost/staff-service/test/staff-service.test.js +++ b/ghost/staff-service/test/staff-service.test.js @@ -366,6 +366,9 @@ 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 without reason', async function () { @@ -389,6 +392,9 @@ 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(); }); }); });