Skip to content

Commit dcdfc88

Browse files
committed
[Mailer] fixed previous merge
1 parent 00a1c7d commit dcdfc88

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Exception/UnsupportedHostException.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,17 @@ class UnsupportedHostException extends LogicException
4848

4949
public function __construct(Dsn $dsn)
5050
{
51-
$host = $dsn->getHost();
52-
$package = self::HOST_TO_PACKAGE_MAP[$host] ?? null;
51+
$provider = $dsn->getScheme();
52+
if (false !== $pos = strpos($provider, '+')) {
53+
$provider = substr($provider, 0, $pos);
54+
}
55+
$package = self::HOST_TO_PACKAGE_MAP[$provider] ?? null;
5356
if ($package && !class_exists($package['class'])) {
5457
parent::__construct(sprintf('Unable to send emails via "%s" as the bridge is not installed. Try running "composer require %s".', $host, $package['package']));
5558

5659
return;
5760
}
5861

59-
parent::__construct(sprintf('The "%s" mailer is not supported.', $host));
62+
parent::__construct(sprintf('The "%s" scheme is not supported.', $dsn->getScheme()));
6063
}
6164
}

0 commit comments

Comments
 (0)