Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missed params to the create method for DomainV4.php #921

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading