Ensure filter segments display for draft/scheduled

This is only tangentially related to this ticket. I noticed during
testing that the filter segment tag was not showing up in listings for
standard newsletters that were drafts or scheduled. This is because
options weren't included in the response for standard newsletters.

MAILPOET-5512
This commit is contained in:
John Oleksowicz
2023-10-06 15:36:54 -05:00
committed by Aschepikov
parent fa86703637
commit 53bc5a2505

View File

@@ -164,6 +164,7 @@ class NewslettersResponseBuilder {
if ($newsletter->getType() === NewsletterEntity::TYPE_STANDARD) {
$data['segments'] = $this->buildSegments($newsletter);
$data['queue'] = $latestQueue ? $this->buildQueue($latestQueue) : false; // false for BC
$data['options'] = $this->buildOptions($newsletter);
} elseif (in_array($newsletter->getType(), [NewsletterEntity::TYPE_WELCOME, NewsletterEntity::TYPE_AUTOMATIC], true)) {
$data['segments'] = [];
$data['options'] = $this->buildOptions($newsletter);