src/Api/Domain.php
public function createCredential(string $domain, string $login, string $password)
    {
        Assert::stringNotEmpty($domain);
        Assert::stringNotEmpty($login);
        Assert::stringNotEmpty($password);
        Assert::lengthBetween($password, 5, 32, 'SMTP password must be between 5 and 32 characters.');

        $params = [
            'login' => $login,
            'password' => $password,
        ];

        $response = $this->httpPost(sprintf('/v3/domains/%s/credentials', $domain), $params);

        return $this->hydrateResponse($response, CreateCredentialResponse::class);
    }
public function createCredential(string $domain, string $login, string $password)
    {
        Assert::stringNotEmpty($domain);
        Assert::stringNotEmpty($login);
        Assert::stringNotEmpty($password);
        Assert::lengthBetween($password, 5, 32, 'SMTP password must be between 5 and 32 characters.');

        $params = [
            'login' => $login,
            'password' => $password,
        ];

        $response = $this->httpPost(sprintf('/v3/domains/%s/credentials', $domain), $params);

        return $this->hydrateResponse($response, CreateCredentialResponse::class);
    }
public function createCredential ( string $ domain , string $ login , string $ password ) { Assert :: stringNotEmpty ( $ domain ) ; Assert :: stringNotEmpty ( $ login ) ; Assert :: stringNotEmpty ( $ password ) ; Assert :: lengthBetween ( $ password , 5 , 32 , 'SMTP password must be between 5 and 32 characters.' ) ; $ params = [ 'login' => $ login , 'password' => $ password , ] ; $ response = $ this -> httpPost ( sprintf ( '/v3/domains/%s/credentials' , $ domain ) , $ params ) ; return $ this -> hydrateResponse ( $ response , CreateCredentialResponse :: class ) ; }
Create a new SMTP credential pair for the specified domain.

@param string $domain   name of the domain
@param string $login    SMTP Username
@param string $password SMTP Password. Length min 5, max 32.

@return CreateCredentialResponse|array|ResponseInterface
Create a new SMTP credential pair for the specified domain .