diff --git a/CHANGELOG.md b/CHANGELOG.md index af3d328a..d9449118 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,10 @@ # Release Notes for Campaign -## 3.5.3 - Unreleased +## 3.5.3 - 2024-10-08 ### Fixed +- Fixed the calculation of pending recipients to not include drafts. - Fixed the sendout status colour indicators on sendout preview pages. ## 3.5.2 - 2024-10-04 diff --git a/src/records/ContactMailingListRecord.php b/src/records/ContactMailingListRecord.php index 1ba48c00..aeb10d39 100644 --- a/src/records/ContactMailingListRecord.php +++ b/src/records/ContactMailingListRecord.php @@ -41,11 +41,13 @@ public static function tableName(): string */ public static function find(): ActiveQuery { - // Create a subquery to ensure only contacts and mailing lists that are not deleted are returned + // Create a subquery to ensure only contacts and mailing lists that are not drafts not deleted are returned $subquery = parent::find() ->innerJoin(Table::ELEMENTS . ' contactElement', '[[contactElement.id]] = [[contactId]]') ->innerJoin(Table::ELEMENTS . ' mailingListElement', '[[mailingListElement.id]] = [[mailingListId]]') ->where([ + 'contactElement.draftId' => null, + 'mailingListElement.draftId' => null, 'contactElement.dateDeleted' => null, 'mailingListElement.dateDeleted' => null, ]); diff --git a/src/services/SendoutsService.php b/src/services/SendoutsService.php index 03ab675f..b1d52fea 100755 --- a/src/services/SendoutsService.php +++ b/src/services/SendoutsService.php @@ -606,7 +606,7 @@ private function getPendingRecipientsStandardIds(SendoutElement $sendout): array // Get contacts subscribed to sendout’s mailing lists $query = ContactMailingListRecord::find() ->select(['contactId']) - ->andWhere($baseCondition); + ->where($baseCondition); // Ensure contacts have not complained, bounced, or been blocked (in contact record) $query->innerJoin(ContactRecord::tableName() . ' contact', '[[contact.id]] = [[contactId]]')