Skip to content

Commit 63a179d

Browse files
committed
app: fix email config keys
1 parent 3432cad commit 63a179d

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

app/Console/Commands/Environment/EmailSettingsCommand.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,6 @@ public function handle()
6767
$this->config->get('mail.from.name')
6868
);
6969

70-
$this->variables['MAIL_ENCRYPTION'] = $this->option('encryption') ?? $this->choice(
71-
trans('command/messages.environment.mail.ask_encryption'),
72-
['tls' => 'TLS', 'ssl' => 'SSL', '' => 'None'],
73-
$this->config->get('mail.encryption', 'tls')
74-
);
75-
7670
$this->writeToEnvironment($this->variables);
7771

7872
$this->line('Updating stored environment configuration file.');
@@ -102,6 +96,12 @@ private function setupSmtpDriverVariables()
10296
$this->variables['MAIL_PASSWORD'] = $this->option('password') ?? $this->secret(
10397
trans('command/messages.environment.mail.ask_smtp_password')
10498
);
99+
100+
$this->variables['MAIL_ENCRYPTION'] = $this->option('encryption') ?? $this->choice(
101+
trans('command/messages.environment.mail.ask_encryption'),
102+
['tls' => 'TLS', 'ssl' => 'SSL', '' => 'None'],
103+
$this->config->get('mail.mailers.smtp.encryption', 'tls')
104+
);
105105
}
106106

107107
/**

app/Providers/SettingsServiceProvider.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ class SettingsServiceProvider extends ServiceProvider
3737
* when using the SMTP driver.
3838
*/
3939
protected array $emailKeys = [
40-
'mail:host',
41-
'mail:port',
40+
'mail:mailers:smtp:host',
41+
'mail:mailers:smtp:port',
42+
'mail:mailers:smtp:encryption',
43+
'mail:mailers:smtp:username',
44+
'mail:mailers:smtp:password',
4245
'mail:from:address',
4346
'mail:from:name',
44-
'mail:encryption',
45-
'mail:username',
46-
'mail:password',
4747
];
4848

4949
/**

resources/views/admin/settings/mail.blade.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,24 @@
3838
<div class="form-group col-md-6">
3939
<label class="control-label">SMTP Host</label>
4040
<div>
41-
<input required type="text" class="form-control" name="mail:host" value="{{ old('mail:host', config('mail.mailers.smtp.host')) }}" />
41+
<input required type="text" class="form-control" name="mail:mailers:smtp:host" value="{{ old('mail:mailers:smtp:host', config('mail.mailers.smtp.host')) }}" />
4242
<p class="text-muted small">Enter the SMTP server address that mail should be sent through.</p>
4343
</div>
4444
</div>
4545
<div class="form-group col-md-2">
4646
<label class="control-label">SMTP Port</label>
4747
<div>
48-
<input required type="number" class="form-control" name="mail:port" value="{{ old('mail:port', config('mail.mailers.smtp.port')) }}" />
48+
<input required type="number" class="form-control" name="mail:mailers:smtp:port" value="{{ old('mail:mailers:smtp:port', config('mail.mailers.smtp.port')) }}" />
4949
<p class="text-muted small">Enter the SMTP server port that mail should be sent through.</p>
5050
</div>
5151
</div>
5252
<div class="form-group col-md-4">
5353
<label class="control-label">Encryption</label>
5454
<div>
5555
@php
56-
$encryption = old('mail:encryption', config('mail.mailers.smtp.encryption'));
56+
$encryption = old('mail:mailers:smtp:encryption', config('mail.mailers.smtp.encryption'));
5757
@endphp
58-
<select name="mail:encryption" class="form-control">
58+
<select name="mail:mailers:smtp:encryption" class="form-control">
5959
<option value="" @if($encryption === '') selected @endif>None</option>
6060
<option value="tls" @if($encryption === 'tls') selected @endif>Transport Layer Security (TLS)</option>
6161
<option value="ssl" @if($encryption === 'ssl') selected @endif>Secure Sockets Layer (SSL)</option>
@@ -66,14 +66,14 @@
6666
<div class="form-group col-md-6">
6767
<label class="control-label">Username <span class="field-optional"></span></label>
6868
<div>
69-
<input type="text" class="form-control" name="mail:username" value="{{ old('mail:username', config('mail.mailers.smtp.username')) }}" />
69+
<input type="text" class="form-control" name="mail:mailers:smtp:username" value="{{ old('mail:mailers:smtp:username', config('mail.mailers.smtp.username')) }}" />
7070
<p class="text-muted small">The username to use when connecting to the SMTP server.</p>
7171
</div>
7272
</div>
7373
<div class="form-group col-md-6">
7474
<label class="control-label">Password <span class="field-optional"></span></label>
7575
<div>
76-
<input type="password" class="form-control" name="mail:password"/>
76+
<input type="password" class="form-control" name="mail:mailers:smtp:password"/>
7777
<p class="text-muted small">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 <code>!e</code> into the field.</p>
7878
</div>
7979
</div>
@@ -120,11 +120,11 @@ function saveSettings() {
120120
url: '/admin/settings/mail',
121121
contentType: 'application/json',
122122
data: JSON.stringify({
123-
'mail:host': $('input[name="mail:host"]').val(),
124-
'mail:port': $('input[name="mail:port"]').val(),
125-
'mail:encryption': $('select[name="mail:encryption"]').val(),
126-
'mail:username': $('input[name="mail:username"]').val(),
127-
'mail:password': $('input[name="mail:password"]').val(),
123+
'mail:mailers:smtp:host': $('input[name="mail:mailers:smtp:host"]').val(),
124+
'mail:mailers:smtp:port': $('input[name="mail:mailers:smtp:port"]').val(),
125+
'mail:mailers:smtp:encryption': $('select[name="mail:mailers:smtp:encryption"]').val(),
126+
'mail:mailers:smtp:username': $('input[name="mail:mailers:smtp:username"]').val(),
127+
'mail:mailers:smtp:password': $('input[name="mail:mailers:smtp:password"]').val(),
128128
'mail:from:address': $('input[name="mail:from:address"]').val(),
129129
'mail:from:name': $('input[name="mail:from:name"]').val()
130130
}),

0 commit comments

Comments
 (0)