diff --git a/app/Console/Commands/Environment/EmailSettingsCommand.php b/app/Console/Commands/Environment/EmailSettingsCommand.php index 1fd9a2aee..cffb03a6b 100644 --- a/app/Console/Commands/Environment/EmailSettingsCommand.php +++ b/app/Console/Commands/Environment/EmailSettingsCommand.php @@ -67,12 +67,6 @@ class EmailSettingsCommand extends Command $this->config->get('mail.from.name') ); - $this->variables['MAIL_ENCRYPTION'] = $this->option('encryption') ?? $this->choice( - trans('command/messages.environment.mail.ask_encryption'), - ['tls' => 'TLS', 'ssl' => 'SSL', '' => 'None'], - $this->config->get('mail.encryption', 'tls') - ); - $this->writeToEnvironment($this->variables); $this->line('Updating stored environment configuration file.'); @@ -102,6 +96,12 @@ class EmailSettingsCommand extends Command $this->variables['MAIL_PASSWORD'] = $this->option('password') ?? $this->secret( trans('command/messages.environment.mail.ask_smtp_password') ); + + $this->variables['MAIL_ENCRYPTION'] = $this->option('encryption') ?? $this->choice( + trans('command/messages.environment.mail.ask_encryption'), + ['tls' => 'TLS', 'ssl' => 'SSL', '' => 'None'], + $this->config->get('mail.mailers.smtp.encryption', 'tls') + ); } /** diff --git a/app/Providers/SettingsServiceProvider.php b/app/Providers/SettingsServiceProvider.php index 9c8a7445e..528e3ae50 100644 --- a/app/Providers/SettingsServiceProvider.php +++ b/app/Providers/SettingsServiceProvider.php @@ -37,13 +37,13 @@ class SettingsServiceProvider extends ServiceProvider * when using the SMTP driver. */ protected array $emailKeys = [ - 'mail:host', - 'mail:port', + 'mail:mailers:smtp:host', + 'mail:mailers:smtp:port', + 'mail:mailers:smtp:encryption', + 'mail:mailers:smtp:username', + 'mail:mailers:smtp:password', 'mail:from:address', 'mail:from:name', - 'mail:encryption', - 'mail:username', - 'mail:password', ]; /** diff --git a/resources/views/admin/settings/mail.blade.php b/resources/views/admin/settings/mail.blade.php index b13446995..9e99acd30 100644 --- a/resources/views/admin/settings/mail.blade.php +++ b/resources/views/admin/settings/mail.blade.php @@ -38,14 +38,14 @@
- +

Enter the SMTP server address that mail should be sent through.

- +

Enter the SMTP server port that mail should be sent through.

@@ -53,9 +53,9 @@
@php - $encryption = old('mail:encryption', config('mail.mailers.smtp.encryption')); + $encryption = old('mail:mailers:smtp:encryption', config('mail.mailers.smtp.encryption')); @endphp - @@ -66,14 +66,14 @@
- +

The username to use when connecting to the SMTP server.

- +

The password to use in conjunction with the SMTP username. Leave blank to continue using the existing password. To set the password to an empty value enter !e into the field.

@@ -120,11 +120,11 @@ url: '/admin/settings/mail', contentType: 'application/json', data: JSON.stringify({ - 'mail:host': $('input[name="mail:host"]').val(), - 'mail:port': $('input[name="mail:port"]').val(), - 'mail:encryption': $('select[name="mail:encryption"]').val(), - 'mail:username': $('input[name="mail:username"]').val(), - 'mail:password': $('input[name="mail:password"]').val(), + 'mail:mailers:smtp:host': $('input[name="mail:mailers:smtp:host"]').val(), + 'mail:mailers:smtp:port': $('input[name="mail:mailers:smtp:port"]').val(), + 'mail:mailers:smtp:encryption': $('select[name="mail:mailers:smtp:encryption"]').val(), + 'mail:mailers:smtp:username': $('input[name="mail:mailers:smtp:username"]').val(), + 'mail:mailers:smtp:password': $('input[name="mail:mailers:smtp:password"]').val(), 'mail:from:address': $('input[name="mail:from:address"]').val(), 'mail:from:name': $('input[name="mail:from:name"]').val() }),