Fix using sent email post content as new email editor page template

MAILPOET-5949
This commit is contained in:
Oluwaseun Olorunsola
2024-12-05 16:54:36 +01:00
committed by Oluwaseun Olorunsola
parent 651e80b8f0
commit 16e4346d07
2 changed files with 21 additions and 5 deletions

View File

@ -117,9 +117,18 @@ export function usePreviewTemplates( customEmailContent = '' ) {
slug: post.slug,
previewContentParsed: parsedPostContent,
emailParsed: parsedPostContent,
template: post,
template: {
...post,
title: {
raw: post?.mailpoet_data?.subject || post.title.raw,
rendered:
post?.mailpoet_data?.subject || post.title.rendered, // use MailPoet subject as title
},
mailpoet_email_theme: null,
email_theme_css: '',
},
category: 'recent',
};
} ),
} ) as unknown as TemplatePreview[],
];
}