From 9d875e7d450bf14455d3f82f67286a083ebcd05e Mon Sep 17 00:00:00 2001 From: Naz Date: Wed, 11 May 2022 10:08:32 +0800 Subject: [PATCH] Fixed use of integration name in the email subject refs https://github.com/TryGhost/Toolbox/issues/292 - The integraton name should be used instead of the user agent! --- .../lib/api-version-compatibility-service.js | 2 +- .../test/api-version-compatibility-service.test.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ghost/api-version-compatibility-service/lib/api-version-compatibility-service.js b/ghost/api-version-compatibility-service/lib/api-version-compatibility-service.js index e524d4a85c..67bb9b0a2f 100644 --- a/ghost/api-version-compatibility-service/lib/api-version-compatibility-service.js +++ b/ghost/api-version-compatibility-service/lib/api-version-compatibility-service.js @@ -52,7 +52,7 @@ class APIVersionCompatibilityService { const subject = (trimmedUseAgent === 'Zapier') ? 'Attention required: One of your Zaps has failed' - : `Attention required: Your ${trimmedUseAgent} integration has failed`; + : `Attention required: Your ${integrationName} integration has failed`; const {html, text} = await this.emailContentGenerator.getContent({ template, diff --git a/ghost/api-version-compatibility-service/test/api-version-compatibility-service.test.js b/ghost/api-version-compatibility-service/test/api-version-compatibility-service.test.js index f80857cbe5..99b8e6903f 100644 --- a/ghost/api-version-compatibility-service/test/api-version-compatibility-service.test.js +++ b/ghost/api-version-compatibility-service/test/api-version-compatibility-service.test.js @@ -77,7 +77,7 @@ describe('APIVersionCompatibilityService', function () { await compatibilityService.handleMismatch({ acceptVersion: 'v4.5', contentVersion: 'v5.1', - userAgent: 'Elaborate Fox', + userAgent: 'GhostAdminSDK/2.4.0', requestURL: 'https://amazeballsghostsite.com/ghost/api/admin/posts/dew023d9203se4', apiKeyValue: 'secret', apiKeyType: 'content' @@ -141,7 +141,7 @@ describe('APIVersionCompatibilityService', function () { await compatibilityService.handleMismatch({ acceptVersion: 'v4.5', contentVersion: 'v5.1', - userAgent: 'Elaborate Fox', + userAgent: 'GhostAdminSDK/2.4.0', requestURL: 'https://amazeballsghostsite.com/ghost/api/admin/posts/dew023d9203se4', apiKeyValue: 'secret', apiKeyType: 'content' @@ -171,7 +171,7 @@ describe('APIVersionCompatibilityService', function () { await compatibilityService.handleMismatch({ acceptVersion: 'v4.5', contentVersion: 'v5.1', - userAgent: 'Elaborate Fox', + userAgent: 'GhostAdminSDK/2.4.0', requestURL: 'does not matter', apiKeyValue: 'secret', apiKeyType: 'content' @@ -247,7 +247,7 @@ describe('APIVersionCompatibilityService', function () { await compatibilityService.handleMismatch({ acceptVersion: 'v4.5', contentVersion: 'v5.1', - userAgent: 'Elaborate Fox', + userAgent: 'GhostAdminSDK/2.4.0', requestURL: 'https://amazeballsghostsite.com/ghost/api/admin/posts/dew023d9203se4', apiKeyValue: 'secret', apiKeyType: 'content' @@ -298,7 +298,7 @@ describe('APIVersionCompatibilityService', function () { await compatibilityService.handleMismatch({ acceptVersion: 'v4.8', contentVersion: 'v5.1', - userAgent: 'Elaborate Fox', + userAgent: 'GhostAdminSDK/2.4.0', requestURL: 'https://amazeballsghostsite.com/ghost/api/admin/posts/dew023d9203se4', apiKeyValue: 'secret', apiKeyType: 'content'