[Mailer] fixed previous merge
This commit is contained in:
parent
2ad7f97568
commit
9e0640a281
@ -54,7 +54,7 @@ class MailgunApiTransport extends AbstractApiTransport
|
||||
$headers[] = $header->toString();
|
||||
}
|
||||
|
||||
$endpoint = str_replace('%domain%', urlencode($this->domain), $this->getEndpoint()).'/v3/%domain%/messages';
|
||||
$endpoint = sprintf('%s/v3/%s/messages', $this->getEndpoint(), urlencode($this->domain));
|
||||
$response = $this->client->request('POST', 'https://'.$endpoint, [
|
||||
'auth_basic' => 'api:'.$this->key,
|
||||
'headers' => $headers,
|
||||
|
@ -57,7 +57,7 @@ class MailgunHttpTransport extends AbstractHttpTransport
|
||||
$headers[] = $header->toString();
|
||||
}
|
||||
|
||||
$endpoint = str_replace('%domain%', urlencode($this->domain), $this->getEndpoint()).'/v3/%domain%/messages.mime';
|
||||
$endpoint = sprintf('%s/v3/%s/messages.mime', $this->getEndpoint(), urlencode($this->domain));
|
||||
$response = $this->client->request('POST', 'https://'.$endpoint, [
|
||||
'auth_basic' => 'api:'.$this->key,
|
||||
'headers' => $headers,
|
||||
|
@ -48,14 +48,17 @@ class UnsupportedHostException extends LogicException
|
||||
|
||||
public function __construct(Dsn $dsn)
|
||||
{
|
||||
$host = $dsn->getHost();
|
||||
$package = self::HOST_TO_PACKAGE_MAP[$host] ?? null;
|
||||
$provider = $dsn->getScheme();
|
||||
if (false !== $pos = strpos($provider, '+')) {
|
||||
$provider = substr($provider, 0, $pos);
|
||||
}
|
||||
$package = self::HOST_TO_PACKAGE_MAP[$provider] ?? null;
|
||||
if ($package && !class_exists($package['class'])) {
|
||||
parent::__construct(sprintf('Unable to send emails via "%s" as the bridge is not installed. Try running "composer require %s".', $host, $package['package']));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
parent::__construct(sprintf('The "%s" mailer is not supported.', $host));
|
||||
parent::__construct(sprintf('The "%s" scheme is not supported.', $dsn->getScheme()));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user