Removed possibility to use {uuid} replacements in email

fixes https://github.com/TryGhost/Team/issues/2383

A user could use `{uuid}` inside an email only content and it would work. This currently isn't supposed to be used outside internal features (link click tracking, feedback buttons). For now this is only fixed in the new email flow under the email stability flag.
This commit is contained in:
Simon Backx 2023-01-11 15:46:59 +01:00
parent c616f56a2a
commit d5a359f2db

View File

@ -196,6 +196,10 @@ class EmailRenderer {
async renderBody(post, newsletter, segment, options) {
let html = this.renderPostBaseHtml(post);
// We don't allow the usage of the %%{uuid}%% replacement in the email body (only in links and special cases)
// So we need to filter them before we introduce the real %%{uuid}%%
html = html.replace(/%%{uuid}%%/g, '{uuid}');
// Paywall and members only content handling
const isPaidPost = post.get('visibility') === 'paid' || post.get('visibility') === 'tiers';
const membersOnlyIndex = html.indexOf('<!--members-only-->');