From 8a8bd60d1cf382ce64125bfb340ece81c768c2fb Mon Sep 17 00:00:00 2001 From: Fabien 'egg' O'Carroll Date: Mon, 30 Jan 2023 16:44:57 +0700 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20newsletter=20resendi?= =?UTF-8?q?ng=20showing=20incorrect=20recipient=20data?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes https://github.com/TryGhost/Ghost/issues/16125 We weren't taking into account any existing email segment set on the post. This is usually not an issue because during the publishing flow the post.emailSegment and the selectedRecipientFilter are kept in sync, but it becomes and issue when the email fails to send and is later retried - we now have an inconsistency between the two values. --- ghost/admin/app/utils/publish-options.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghost/admin/app/utils/publish-options.js b/ghost/admin/app/utils/publish-options.js index 208eb5fe80..e1ea9730a4 100644 --- a/ghost/admin/app/utils/publish-options.js +++ b/ghost/admin/app/utils/publish-options.js @@ -168,7 +168,7 @@ export default class PublishOptions { } get recipientFilter() { - return this.selectedRecipientFilter === undefined ? this.defaultRecipientFilter : this.selectedRecipientFilter; + return this.selectedRecipientFilter || this.post.emailSegment || this.defaultRecipientFilter; } get defaultRecipientFilter() { From b50e3915ea820e0d337968094b7fc25cafb37313 Mon Sep 17 00:00:00 2001 From: Simon Backx Date: Mon, 30 Jan 2023 14:39:08 +0100 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20HTML=20escaping=20of?= =?UTF-8?q?=20feature=5Fimage=5Fcaption=20in=20newsletters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit no issue feature_image_caption was escaped in the new email stability flow, while that should not happen (bold/underline/...). --- .../services/email-service/batch-sending.test.js | 14 ++++++++++++++ .../email-service/lib/email-templates/template.hbs | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ghost/core/test/integration/services/email-service/batch-sending.test.js b/ghost/core/test/integration/services/email-service/batch-sending.test.js index 0c7103d158..e703a04550 100644 --- a/ghost/core/test/integration/services/email-service/batch-sending.test.js +++ b/ghost/core/test/integration/services/email-service/batch-sending.test.js @@ -743,5 +743,19 @@ describe('Batch sending tests', function () { }); }); + describe('HTML-content', function () { + it('Does not HTML escape feature_image_caption', async function () { + const {html, plaintext} = await sendEmail({ + feature_image: 'https://example.com/image.jpg', + feature_image_caption: 'Testing feature image caption' + }); + // Check html contains text without escaping + assert.match(html, /Testing feature image caption<\/b>/); + + // Check plaintext version dropped the bold tag + assert.match(plaintext, /Testing feature image caption/); + }); + }); + // TODO: Replacement fallbacks }); diff --git a/ghost/email-service/lib/email-templates/template.hbs b/ghost/email-service/lib/email-templates/template.hbs index 6c3f7330ec..3404f5a8ab 100644 --- a/ghost/email-service/lib/email-templates/template.hbs +++ b/ghost/email-service/lib/email-templates/template.hbs @@ -105,7 +105,7 @@ {{#if post.feature_image_caption }} - {{post.feature_image_caption}} + {{{post.feature_image_caption}}} {{/if}} {{/if}} From 249942892af308057f66a6b3eeb1eda248ae3b93 Mon Sep 17 00:00:00 2001 From: Ghost CI <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 30 Jan 2023 16:18:14 +0000 Subject: [PATCH 3/3] v5.33.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 c07c485cba..b5a6614bc5 100644 --- a/ghost/admin/package.json +++ b/ghost/admin/package.json @@ -1,6 +1,6 @@ { "name": "ghost-admin", - "version": "5.33.0", + "version": "5.33.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 5885e78390..9b79c01822 100644 --- a/ghost/core/package.json +++ b/ghost/core/package.json @@ -1,6 +1,6 @@ { "name": "ghost", - "version": "5.33.0", + "version": "5.33.1", "description": "The professional publishing platform", "author": "Ghost Foundation", "homepage": "https://ghost.org",