From bcddba3569cca0bf2645fb4b49fda23a8323b9b6 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Tue, 24 Jun 2025 18:27:09 +0200 Subject: [PATCH] refactor(email): streamline SMTP and resend settings logic for improved clarity --- app/Livewire/Notifications/Email.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/app/Livewire/Notifications/Email.php b/app/Livewire/Notifications/Email.php index 897e6cf06..128321ed2 100644 --- a/app/Livewire/Notifications/Email.php +++ b/app/Livewire/Notifications/Email.php @@ -254,10 +254,9 @@ class Email extends Component 'smtpEncryption.required' => 'Encryption type is required.', ]); - $this->settings->resend_enabled = false; - $this->settings->use_instance_email_settings = false; - $this->resendEnabled = false; - $this->useInstanceEmailSettings = false; + if ($this->smtpEnabled) { + $this->settings->resend_enabled = $this->resendEnabled = false; + } $this->settings->smtp_enabled = $this->smtpEnabled; $this->settings->smtp_from_address = $this->smtpFromAddress; @@ -293,11 +292,9 @@ class Email extends Component 'smtpFromAddress.email' => 'Please enter a valid email address.', 'smtpFromName.required' => 'From Name is required.', ]); - - $this->settings->smtp_enabled = false; - $this->settings->use_instance_email_settings = false; - $this->smtpEnabled = false; - $this->useInstanceEmailSettings = false; + if ($this->resendEnabled) { + $this->settings->smtp_enabled = $this->smtpEnabled = false; + } $this->settings->resend_enabled = $this->resendEnabled; $this->settings->resend_api_key = $this->resendApiKey;