fix: instance email settings

This commit is contained in:
Andras Bacsai 2023-09-08 16:56:14 +02:00
parent 03d9f93397
commit 49f86621f4
2 changed files with 10 additions and 3 deletions

View File

@ -60,7 +60,6 @@ public function submitResend() {
$this->validate([ $this->validate([
'settings.resend_api_key' => 'required' 'settings.resend_api_key' => 'required'
]); ]);
$this->settings->smtp_enabled = false;
$this->settings->save(); $this->settings->save();
$this->emit('success', 'Settings saved successfully.'); $this->emit('success', 'Settings saved successfully.');
} catch (\Exception $e) { } catch (\Exception $e) {
@ -68,9 +67,18 @@ public function submitResend() {
return general_error_handler($e, $this); return general_error_handler($e, $this);
} }
} }
public function instantSaveResend() {
try {
$this->settings->smtp_enabled = false;
$this->submitResend();
} catch (\Exception $e) {
return general_error_handler($e, $this);
}
}
public function instantSave() public function instantSave()
{ {
try { try {
$this->settings->resend_enabled = false;
$this->submit(); $this->submit();
} catch (\Exception $e) { } catch (\Exception $e) {
return general_error_handler($e, $this); return general_error_handler($e, $this);
@ -89,7 +97,6 @@ public function submit()
'settings.smtp_password' => 'nullable', 'settings.smtp_password' => 'nullable',
'settings.smtp_timeout' => 'nullable', 'settings.smtp_timeout' => 'nullable',
]); ]);
$this->settings->resend_enabled = false;
$this->settings->save(); $this->settings->save();
$this->emit('success', 'Settings saved successfully.'); $this->emit('success', 'Settings saved successfully.');
} catch (\Exception $e) { } catch (\Exception $e) {

View File

@ -67,7 +67,7 @@ class="text-white normal-case btn btn-xs no-animation btn-primary">
<summary class="text-xl collapse-title"> <summary class="text-xl collapse-title">
<div>Resend</div> <div>Resend</div>
<div class="w-32"> <div class="w-32">
<x-forms.checkbox instantSave='submitResend' id="settings.resend_enabled" label="Enabled" /> <x-forms.checkbox instantSave='instantSaveResend' id="settings.resend_enabled" label="Enabled" />
</div> </div>
</summary> </summary>
<div class="collapse-content"> <div class="collapse-content">