private function createSmtpTransport(SystemConfigService
$configService): TransportInterface
{ $dsn =
new Dsn( $this->
getEncryption($configService) === 'ssl' ? 'smtps' : 'smtp',
$configService->
getString('core.mailerSettings.host'
),
$configService->
getString('core.mailerSettings.username'
),
$configService->
getString('core.mailerSettings.password'
),
$configService->
getInt('core.mailerSettings.port'
),
$this->
getEncryption($configService) !== null ?
[] :
['verify_peer' => 0
] );
return $this->envBasedTransport->
fromDsnObject($dsn);
} private function getEncryption(SystemConfigService
$configService): ?string
{ $encryption =
$configService->
getString('core.mailerSettings.encryption'
);
return match ($encryption) { 'ssl' => 'ssl',
'tls' => 'tls',
default => null,
};
}