Reset engagement score for inactive subscribers

If someone hasn't received at least 3 emails in the last year, we can't
trust that their level of engagement would be the same now as it was
over a year ago.

MAILPOET-5410
This commit is contained in:
John Oleksowicz
2023-07-21 14:55:32 -05:00
committed by Aschepikov
parent f8e0ba118c
commit 99630f85aa
2 changed files with 14 additions and 0 deletions

View File

@@ -33,6 +33,7 @@ class StatisticsOpensRepository extends Repository {
->getQuery()
->getSingleScalarResult();
if ($newslettersSentCount < 3) {
$subscriber->setEngagementScore(null);
$this->entityManager->flush();
return;
}