Use post notifications history parent to fetch latest sent post

[MAILPOET-2960]
This commit is contained in:
Rostislav Wolny
2020-06-03 12:51:47 +02:00
committed by Veljko V
parent 57f0534241
commit 9f37ee4811

View File

@@ -132,7 +132,7 @@ class Renderer {
if ($parent instanceof NewsletterEntity) {
$newsletterId = $parent->getId();
$lastPost = $this->newsletterPostsRepository->findOneBy(['newsletter' => $newsletter], ['createdAt' => 'desc']);
$lastPost = $this->newsletterPostsRepository->findOneBy(['newsletter' => $parent], ['createdAt' => 'desc']);
if ($lastPost instanceof NewsletterPostEntity) {
$newerThanTimestamp = $lastPost->getCreatedAt();
}