Exclude WP subscribers from sending limit
[MAILPOET-2631]
This commit is contained in:
committed by
Jack Kitterhing
parent
e2a265fa48
commit
5e2559c0ae
@@ -34,4 +34,22 @@ class SubscribersRepository extends Repository {
|
||||
->getQuery();
|
||||
return (int)$query->getSingleScalarResult();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getTotalSubscribersWithoutWPUsers() {
|
||||
$query = $this->entityManager
|
||||
->createQueryBuilder()
|
||||
->select('count(n.id)')
|
||||
->from(SubscriberEntity::class, 'n')
|
||||
->where('n.deletedAt IS NULL AND n.status IN (:statuses) AND n.wpUserId IS NULL')
|
||||
->setParameter('statuses', [
|
||||
SubscriberEntity::STATUS_SUBSCRIBED,
|
||||
SubscriberEntity::STATUS_UNCONFIRMED,
|
||||
SubscriberEntity::STATUS_INACTIVE,
|
||||
])
|
||||
->getQuery();
|
||||
return (int)$query->getSingleScalarResult();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user