Skip to content

Commit 7b52848

Browse files
authored
Merge pull request mautic#14525 from driskell/fix-preview-require-published
fix: Email preview now works again even if unpublished or expired
2 parents 915d3b3 + 430e01e commit 7b52848

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/bundles/EmailBundle/Controller/PublicController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ public function previewAction(AnalyticsHelper $analyticsHelper, EmailConfig $ema
472472
}
473473

474474
if (
475-
($this->security->isAnonymous() && (!$emailEntity->isPublished() || !$publicPreview))
475+
($this->security->isAnonymous() && !$publicPreview)
476476
|| (!$this->security->isAnonymous()
477477
&& !$this->security->hasEntityAccess(
478478
'email:emails:viewown',

app/bundles/EmailBundle/Tests/Controller/PublicControllerFunctionalTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ public function testPreviewForExpiredEmail(): void
338338
$this->em->flush();
339339

340340
$this->client->request('GET', '/email/preview/'.$email->getId());
341-
$this->assertFalse($this->client->getResponse()->isOk());
341+
$this->assertTrue($this->client->getResponse()->isOk());
342342
}
343343

344344
/**

0 commit comments

Comments
 (0)