Skip to content

Commit

Permalink
Fix recipient count bug and typo
Browse files Browse the repository at this point in the history
  • Loading branch information
bencroker committed Apr 7, 2024
1 parent 8989d60 commit 70075cc
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 8 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Release Notes for Campaign

## 2.13.3 - Unreleased

### Fixed

- Fixed a bug in which the total recipient count in running sendouts was being incorrectly displayed.
- Fixed a typo in the `All` interaction type in English.

## 2.13.2 - 2024-04-01

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "putyourlightson/craft-campaign",
"description": "Send and manage email campaigns, contacts and mailing lists.",
"version": "2.13.2",
"version": "2.13.3",
"type": "craft-plugin",
"homepage": "https://putyourlightson.com/plugins/campaign",
"license": "proprietary",
Expand Down
3 changes: 2 additions & 1 deletion src/batchers/SendoutBatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class SendoutBatcher implements Batchable
{
public function __construct(
private ?SendoutElement $sendout,
private int $offset = 0,
) {
}

Expand All @@ -28,7 +29,7 @@ public function count(): int
// Return the number of pending plus sent recipients.
$pendingRecipientCount = Campaign::$plugin->sendouts->getPendingRecipientCount($this->sendout);

return $pendingRecipientCount + $this->sendout->recipients;
return $pendingRecipientCount + $this->offset;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/jobs/SendoutJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ protected function loadData(): SendoutBatcher
return new SendoutBatcher(null);
}

return new SendoutBatcher($sendout);
return new SendoutBatcher($sendout, $this->itemOffset);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/translations/en/campaign.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
'Add the following tag to all Campaign forms (not doing so will prevent forms from submitting).' => '',
'Added' => '',
'Alias Check Failed – one of your site or asset volume URLs is using a dynamic `@web` alias.' => '',
'All' => 'Alle',
'All' => '',
'All campaigns' => '',
'All contacts' => '',
'All mailing lists' => '',
Expand Down
8 changes: 4 additions & 4 deletions tests/TESTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ _Tests contact interactions with campaigns._
_Tests properties of contacts._

![Pass](https://raw.githubusercontent.com/putyourlightson/craft-generate-test-spec/main/icons/pass.svg) A contact with the same email address as another contact cannot be saved.
![Pass](https://raw.githubusercontent.com/putyourlightson/craft-generate-test-spec/main/icons/pass.svg) A contact with the same email address as a soft deleted contact can be saved.
![Pass](https://raw.githubusercontent.com/putyourlightson/craft-generate-test-spec/main/icons/pass.svg) A contact with the same email address as a soft-deleted contact can be saved.

### [Form](pest/Feature/FormTest.php)

Expand All @@ -50,9 +50,9 @@ _Tests importing contacts into mailing lists._
_Tests verifying pending contacts._

![Pass](https://raw.githubusercontent.com/putyourlightson/craft-generate-test-spec/main/icons/pass.svg) Verifying a pending contact creates a contact.
![Pass](https://raw.githubusercontent.com/putyourlightson/craft-generate-test-spec/main/icons/pass.svg) Verifying a pending contact for a soft deleted contact restores the contact.
![Pass](https://raw.githubusercontent.com/putyourlightson/craft-generate-test-spec/main/icons/pass.svg) Verifying a pending contact soft deletes the pending contact.
![Pass](https://raw.githubusercontent.com/putyourlightson/craft-generate-test-spec/main/icons/pass.svg) Verifying a soft deleted pending does nothing.
![Pass](https://raw.githubusercontent.com/putyourlightson/craft-generate-test-spec/main/icons/pass.svg) Verifying a pending contact for a soft-deleted contact restores the contact.
![Pass](https://raw.githubusercontent.com/putyourlightson/craft-generate-test-spec/main/icons/pass.svg) Verifying a pending contact soft-deletes the pending contact.
![Pass](https://raw.githubusercontent.com/putyourlightson/craft-generate-test-spec/main/icons/pass.svg) Verifying a soft-deleted pending does nothing.

### [PendingRecipient](pest/Feature/PendingRecipientTest.php)

Expand Down

0 comments on commit 70075cc

Please sign in to comment.