src/Api/MailingList.php
public function create(string $address, string $name = null, string $description = null, string $accessLevel = 'readonly')
    {
        Assert::stringNotEmpty($address);
        Assert::nullOrStringNotEmpty($name);
        Assert::nullOrStringNotEmpty($description);
        Assert::oneOf($accessLevel, ['readonly', 'members', 'everyone']);

        $params = [
            'address' => $address,
            'name' => $name,
            'description' => $description,
            'access_level' => $accessLevel,
        ];

        $response = $this->httpPost('/v3/lists', $params);

        return $this->hydrateResponse($response, CreateResponse::class);
    }
public function create(string $address, string $name = null, string $description = null, string $accessLevel = 'readonly')
    {
        Assert::stringNotEmpty($address);
        Assert::nullOrStringNotEmpty($name);
        Assert::nullOrStringNotEmpty($description);
        Assert::oneOf($accessLevel, ['readonly', 'members', 'everyone']);

        $params = [
            'address' => $address,
            'name' => $name,
            'description' => $description,
            'access_level' => $accessLevel,
        ];

        $response = $this->httpPost('/v3/lists', $params);

        return $this->hydrateResponse($response, CreateResponse::class);
    }
public function create ( string $ address , string $ name = null , string $ description = null , string $ accessLevel = 'readonly' ) { Assert :: stringNotEmpty ( $ address ) ; Assert :: nullOrStringNotEmpty ( $ name ) ; Assert :: nullOrStringNotEmpty ( $ description ) ; Assert :: oneOf ( $ accessLevel , [ 'readonly' , 'members' , 'everyone' ] ) ; $ params = [ 'address' => $ address , 'name' => $ name , 'description' => $ description , 'access_level' => $ accessLevel , ] ; $ response = $ this -> httpPost ( '/v3/lists' , $ params ) ; return $ this -> hydrateResponse ( $ response , CreateResponse :: class ) ; }
Creates a new mailing list on the current domain.

@param string $address     Address for the new mailing list
@param string $name        Name for the new mailing list (optional)
@param string $description Description for the new mailing list (optional)
@param string $accessLevel List access level, one of: readonly (default), members, everyone

@return CreateResponse

@throws \Exception
Creates a new mailing list on the current domain .