From f42f32ff3eee3ec95e3345a466fe81afe1de4b38 Mon Sep 17 00:00:00 2001 From: Oleksandr Mykhailenko Date: Sat, 17 Aug 2024 13:20:26 +0300 Subject: [PATCH] Add missed params to the `create` method for DomainV4.php --- src/Api/DomainV4.php | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/Api/DomainV4.php b/src/Api/DomainV4.php index a5c5a0f4..7b530c77 100644 --- a/src/Api/DomainV4.php +++ b/src/Api/DomainV4.php @@ -11,7 +11,6 @@ namespace Mailgun\Api; -use Exception; use Mailgun\Assert; use Mailgun\Model\Domain\ConnectionResponse; use Mailgun\Model\Domain\CreateCredentialResponse; @@ -89,13 +88,14 @@ public function show(string $domain, array $requestHeaders = []) * @param bool|null $wildcard * @param bool|null $forceDkimAuthority * @param string[] $ips an array of ips to be assigned to the domain - * @param ?string $pool_id pool id to assign to the domain + * @param ?string $pool_id pool id to assign to the domain * @param string $webScheme `http` or `https` - set your open, click and unsubscribe URLs to use http or https. The default is http - * @param string $dkimKeySize Set length of your domain’s generated DKIM - * key + * @param string $dkimKeySize Set length of your domain’s generated DKIM key * @param array $requestHeaders + * @param string|null $dkimHostName + * @param string|null $dkimSelector * @return CreateResponse|array|ResponseInterface - * @throws Exception|ClientExceptionInterface + * @throws ClientExceptionInterface */ public function create( string $domain, @@ -107,7 +107,10 @@ public function create( ?string $pool_id = null, string $webScheme = 'http', string $dkimKeySize = '1024', - array $requestHeaders = [] + array $requestHeaders = [], + ?string $dkimHostName = null, + ?string $dkimSelector = null, + ) { Assert::stringNotEmpty($domain); @@ -162,6 +165,16 @@ public function create( $params['dkim_key_size'] = $dkimKeySize; } + if (!empty($dkimHostName)) { + Assert::stringNotEmpty($dkimHostName); + $params['dkim_host_name'] = $dkimHostName; + } + + if (!empty($dkimSelector)) { + Assert::stringNotEmpty($dkimSelector); + $params['dkim_selector'] = $dkimSelector; + } + $response = $this->httpPost('/v4/domains', $params, $requestHeaders); return $this->hydrateResponse($response, CreateResponse::class);