minor #39465 [Mailer] [Sendgrid] Use $scheme variable to stay consistent (OskarStark)
This PR was merged into the 4.4 branch.
Discussion
----------
[Mailer] [Sendgrid] Use $scheme variable to stay consistent
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | ---
| License | MIT
| Doc PR | ---
Its used like this in all other mailer bridges
Commits
-------
1a40d7c75a
[Mailer] [Sendgrid] Use $scheme variable to stay consistent
This commit is contained in:
commit
278688deeb
@ -23,16 +23,17 @@ final class SendgridTransportFactory extends AbstractTransportFactory
|
|||||||
{
|
{
|
||||||
public function create(Dsn $dsn): TransportInterface
|
public function create(Dsn $dsn): TransportInterface
|
||||||
{
|
{
|
||||||
|
$scheme = $dsn->getScheme();
|
||||||
$key = $this->getUser($dsn);
|
$key = $this->getUser($dsn);
|
||||||
|
|
||||||
if ('sendgrid+api' === $dsn->getScheme()) {
|
if ('sendgrid+api' === $scheme) {
|
||||||
$host = 'default' === $dsn->getHost() ? null : $dsn->getHost();
|
$host = 'default' === $dsn->getHost() ? null : $dsn->getHost();
|
||||||
$port = $dsn->getPort();
|
$port = $dsn->getPort();
|
||||||
|
|
||||||
return (new SendgridApiTransport($key, $this->client, $this->dispatcher, $this->logger))->setHost($host)->setPort($port);
|
return (new SendgridApiTransport($key, $this->client, $this->dispatcher, $this->logger))->setHost($host)->setPort($port);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ('sendgrid+smtp' === $dsn->getScheme() || 'sendgrid+smtps' === $dsn->getScheme() || 'sendgrid' === $dsn->getScheme()) {
|
if ('sendgrid+smtp' === $scheme || 'sendgrid+smtps' === $scheme || 'sendgrid' === $scheme) {
|
||||||
return new SendgridSmtpTransport($key, $this->dispatcher, $this->logger);
|
return new SendgridSmtpTransport($key, $this->dispatcher, $this->logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user