Add endpoint to the create function

This commit is contained in:
Nyholm 2018-08-04 23:28:57 +02:00 committed by David Garcia
parent 1835bc28d7
commit 860d49d9d2

View File

@ -107,9 +107,11 @@ class Mailgun
*
* @return Mailgun
*/
public static function create($apiKey)
public static function create($apiKey, $endpoint = 'https://api.mailgun.net')
{
$httpClientConfigurator = (new HttpClientConfigurator())->setApiKey($apiKey);
$httpClientConfigurator = (new HttpClientConfigurator())
->setApiKey($apiKey)
->setEndpoint($endpoint);
return self::configure($httpClientConfigurator);
}