Forbid scheduling of welcome email form trashed segment or subscriber

[MAILPOET-3141]
This commit is contained in:
Rostislav Wolny
2020-11-02 16:28:41 +01:00
committed by Veljko V
parent 65ca040a20
commit 6fcb485e61
3 changed files with 206 additions and 26 deletions

View File

@@ -13,6 +13,10 @@ class SegmentsRepository extends Repository {
return SegmentEntity::class;
}
public function getWPUsersSegment() {
return $this->findOneBy(['type' => SegmentEntity::TYPE_WP_USERS]);
}
public function getCountsPerType(): array {
$results = $this->doctrineRepository->createQueryBuilder('s')
->select('s.type, COUNT(s) as cnt')