Skip to content

Commit

Permalink
Added missing domain settings (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
doobas authored Jul 3, 2023
1 parent 46984b8 commit 836233e
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
26 changes: 26 additions & 0 deletions src/Helpers/Builder/DomainSettingsParams.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ class DomainSettingsParams
protected ?string $track_unsubscribe_plain = null;
protected ?bool $custom_tracking_enabled = null;
protected ?string $custom_tracking_subdomain = null;
protected ?bool $precedence_bulk = null;
protected ?bool $ignore_duplicated_recipients = null;

public function getSendPaused(): ?bool
{
Expand Down Expand Up @@ -113,6 +115,28 @@ public function setCustomTrackingSubdomain(?string $custom_tracking_subdomain):
return $this;
}

public function getPrecedenceBulk(): ?bool
{
return $this->precedence_bulk;
}

public function setPrecedenceBulk(?bool $precedence_bulk): DomainSettingsParams
{
$this->precedence_bulk = $precedence_bulk;
return $this;
}

public function getIgnoreDuplicatedRecipients(): ?bool
{
return $this->ignore_duplicated_recipients;
}

public function setIgnoreDuplicatedRecipients(?bool $ignore_duplicated_recipients): DomainSettingsParams
{
$this->ignore_duplicated_recipients = $ignore_duplicated_recipients;
return $this;
}

public function toArray(): array
{
return [
Expand All @@ -125,6 +149,8 @@ public function toArray(): array
'track_unsubscribe_plain' => $this->getTrackUnsubscribePlain(),
'custom_tracking_enabled' => $this->getCustomTrackingEnabled(),
'custom_tracking_subdomain' => $this->getCustomTrackingSubdomain(),
'precedence_bulk' => $this->getPrecedenceBulk(),
'ignore_duplicated_recipients' => $this->getIgnoreDuplicatedRecipients(),
];
}
}
14 changes: 13 additions & 1 deletion tests/Endpoints/DomainTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ public function test_domain_settings(DomainSettingsParams $domainSettingsParams)
self::assertEquals($domainSettingsParams->getTrackUnsubscribePlain(), Arr::get($request_body, 'track_unsubscribe_plain'));
self::assertEquals($domainSettingsParams->getCustomTrackingEnabled(), Arr::get($request_body, 'custom_tracking_enabled'));
self::assertEquals($domainSettingsParams->getCustomTrackingSubdomain(), Arr::get($request_body, 'custom_tracking_subdomain'));
self::assertEquals($domainSettingsParams->getPrecedenceBulk(), Arr::get($request_body, 'precedence_bulk'));
self::assertEquals($domainSettingsParams->getIgnoreDuplicatedRecipients(), Arr::get($request_body, 'ignore_duplicated_recipients'));
}

/**
Expand Down Expand Up @@ -377,7 +379,9 @@ public function domainSettingsDataProvider(): array
->setTrackUnsubscribeHtml('html')
->setTrackUnsubscribePlain('plain')
->setCustomTrackingEnabled(true)
->setCustomTrackingSubdomain(false),
->setCustomTrackingSubdomain(false)
->setPrecedenceBulk(false)
->setIgnoreDuplicatedRecipients(false),
],
'with send paused' => [
(new DomainSettingsParams())
Expand Down Expand Up @@ -415,6 +419,14 @@ public function domainSettingsDataProvider(): array
(new DomainSettingsParams())
->setCustomTrackingSubdomain(true),
],
'with precedence bulk' => [
(new DomainSettingsParams())
->setCustomTrackingSubdomain(true),
],
'with ignore duplicated emails' => [
(new DomainSettingsParams())
->setIgnoreDuplicatedRecipients(true),
],
];
}
}

0 comments on commit 836233e

Please sign in to comment.