🐛 Fixed newsletter resending showing incorrect recipient data

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.
This commit is contained in:
Fabien 'egg' O'Carroll 2023-01-30 16:44:57 +07:00 committed by Simon Backx
parent 829c325e51
commit 8a8bd60d1c

View File

@ -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() {