Skip to content

Commit 99e09e0

Browse files
Merge pull request #921 from mailgun/DE-1298-mailgun-sdk-feature-request-add-dkim-host-name-and-dkim-selector-options-to-domains-create-method
Add missed params to the `create` method for DomainV4.php
2 parents a2e70ab + f42f32f commit 99e09e0

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

src/Api/DomainV4.php

+19-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Mailgun\Api;
1313

14-
use Exception;
1514
use Mailgun\Assert;
1615
use Mailgun\Model\Domain\ConnectionResponse;
1716
use Mailgun\Model\Domain\CreateCredentialResponse;
@@ -89,13 +88,14 @@ public function show(string $domain, array $requestHeaders = [])
8988
* @param bool|null $wildcard
9089
* @param bool|null $forceDkimAuthority
9190
* @param string[] $ips an array of ips to be assigned to the domain
92-
* @param ?string $pool_id pool id to assign to the domain
91+
* @param ?string $pool_id pool id to assign to the domain
9392
* @param string $webScheme `http` or `https` - set your open, click and unsubscribe URLs to use http or https. The default is http
94-
* @param string $dkimKeySize Set length of your domain’s generated DKIM
95-
* key
93+
* @param string $dkimKeySize Set length of your domain’s generated DKIM key
9694
* @param array $requestHeaders
95+
* @param string|null $dkimHostName
96+
* @param string|null $dkimSelector
9797
* @return CreateResponse|array|ResponseInterface
98-
* @throws Exception|ClientExceptionInterface
98+
* @throws ClientExceptionInterface
9999
*/
100100
public function create(
101101
string $domain,
@@ -107,7 +107,10 @@ public function create(
107107
?string $pool_id = null,
108108
string $webScheme = 'http',
109109
string $dkimKeySize = '1024',
110-
array $requestHeaders = []
110+
array $requestHeaders = [],
111+
?string $dkimHostName = null,
112+
?string $dkimSelector = null,
113+
111114
) {
112115
Assert::stringNotEmpty($domain);
113116

@@ -162,6 +165,16 @@ public function create(
162165
$params['dkim_key_size'] = $dkimKeySize;
163166
}
164167

168+
if (!empty($dkimHostName)) {
169+
Assert::stringNotEmpty($dkimHostName);
170+
$params['dkim_host_name'] = $dkimHostName;
171+
}
172+
173+
if (!empty($dkimSelector)) {
174+
Assert::stringNotEmpty($dkimSelector);
175+
$params['dkim_selector'] = $dkimSelector;
176+
}
177+
165178
$response = $this->httpPost('/v4/domains', $params, $requestHeaders);
166179

167180
return $this->hydrateResponse($response, CreateResponse::class);

0 commit comments

Comments
 (0)