Skip to content

Commit

Permalink
Add missed params to the create method for DomainV4.php
Browse files Browse the repository at this point in the history
  • Loading branch information
oleksandr-mykhailenko committed Aug 17, 2024
1 parent a2e70ab commit f42f32f
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions src/Api/DomainV4.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace Mailgun\Api;

use Exception;
use Mailgun\Assert;
use Mailgun\Model\Domain\ConnectionResponse;
use Mailgun\Model\Domain\CreateCredentialResponse;
Expand Down Expand Up @@ -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,
Expand All @@ -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);

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit f42f32f

Please sign in to comment.