1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 22:24:03 +00:00

Add separate method to pick the appropriate mail credentials map preset

This commit is contained in:
lukinovec 2022-11-02 15:05:10 +01:00
parent 6d464a19b7
commit 9116ffc792

View file

@ -34,12 +34,15 @@ class MailTenancyBootstrapper implements TenancyBootstrapper
public function __construct(protected Repository $config) public function __construct(protected Repository $config)
{ {
$mapPreset = match ($config->get('mail.default')) { static::$credentialsMap = array_merge(static::$credentialsMap, $this->pickMapPreset() ?? []);
}
protected function pickMapPreset(): array|null
{
return match ($this->config->get('mail.default')) {
'smtp' => static::smtpCredentialsMap(), 'smtp' => static::smtpCredentialsMap(),
default => null, default => null,
}; };
static::$credentialsMap = array_merge(static::$credentialsMap, $mapPreset ?? []);
} }
public function bootstrap(Tenant $tenant): void public function bootstrap(Tenant $tenant): void