From a8368a261cb26b3a068199dea00a220b78c48c7e Mon Sep 17 00:00:00 2001 From: Rishabh Date: Mon, 5 Sep 2022 23:13:40 +0530 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20paid=20subscription?= =?UTF-8?q?=20alert=20showing=20incorrect=20offer=20amount?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes https://github.com/TryGhost/Team/issues/1876 - the offer portion of new paid subscription alert was showing the wrong amount as the value is denoted in cents and needs conversion - the value shown was 100x as the actual amount needs to be transformed (X/100) --- ghost/staff-service/lib/emails.js | 3 ++- ghost/staff-service/test/staff-service.test.js | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ghost/staff-service/lib/emails.js b/ghost/staff-service/lib/emails.js index 765ed99569..cad60b879c 100644 --- a/ghost/staff-service/lib/emails.js +++ b/ghost/staff-service/lib/emails.js @@ -230,7 +230,8 @@ class StaffServiceEmails { if (offer.type === 'percent') { offAmount = `${offer.amount}% off`; } else if (offer.type === 'fixed') { - offAmount = `${this.getFormattedAmount({currency: offer.currency, amount: offer.amount})} off`; + const amount = this.getAmount(offer.amount); + offAmount = `${this.getFormattedAmount({currency: offer.currency, amount})} off`; } else if (offer.type === 'trial') { offAmount = `${offer.amount} days free`; } diff --git a/ghost/staff-service/test/staff-service.test.js b/ghost/staff-service/test/staff-service.test.js index 9285e97b26..bb79d3ed19 100644 --- a/ghost/staff-service/test/staff-service.test.js +++ b/ghost/staff-service/test/staff-service.test.js @@ -308,7 +308,7 @@ describe('StaffService', function () { duration_in_months: 3, type: 'fixed', currency: 'USD', - amount: 10 + amount: 1000 }; await service.notifyPaidSubscriptionStart({member, offer, tier, subscription}, options); @@ -333,7 +333,7 @@ describe('StaffService', function () { duration: 'forever', type: 'fixed', currency: 'USD', - amount: 20 + amount: 2000 }; await service.notifyPaidSubscriptionStart({member, offer, tier, subscription}, options); From da1997d96e918f297f352b1e41823c5ea9023d0f Mon Sep 17 00:00:00 2001 From: Ghost CI <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 6 Sep 2022 09:53:23 +0100 Subject: [PATCH 2/2] v5.13.1 --- ghost/admin/package.json | 2 +- ghost/core/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ghost/admin/package.json b/ghost/admin/package.json index 6bc8c4261b..6ccaebd128 100644 --- a/ghost/admin/package.json +++ b/ghost/admin/package.json @@ -1,6 +1,6 @@ { "name": "ghost-admin", - "version": "5.13.0", + "version": "5.13.1", "description": "Ember.js admin client for Ghost", "author": "Ghost Foundation", "homepage": "http://ghost.org", diff --git a/ghost/core/package.json b/ghost/core/package.json index 0d5edeae78..c14f3f4e0c 100644 --- a/ghost/core/package.json +++ b/ghost/core/package.json @@ -1,6 +1,6 @@ { "name": "ghost", - "version": "5.13.0", + "version": "5.13.1", "description": "The professional publishing platform", "author": "Ghost Foundation", "homepage": "https://ghost.org",