diff --git a/app/Livewire/Notifications/Email.php b/app/Livewire/Notifications/Email.php index 3ed20f907..3b732af99 100644 --- a/app/Livewire/Notifications/Email.php +++ b/app/Livewire/Notifications/Email.php @@ -337,32 +337,29 @@ class Email extends Component public function copyFromInstanceSettings() { $settings = instanceSettings(); + $this->smtpFromAddress = $settings->smtp_from_address; + $this->smtpFromName = $settings->smtp_from_name; if ($settings->smtp_enabled) { $this->smtpEnabled = true; - $this->smtpFromAddress = $settings->smtp_from_address; - $this->smtpFromName = $settings->smtp_from_name; - $this->smtpRecipients = $settings->smtp_recipients; - $this->smtpHost = $settings->smtp_host; - $this->smtpPort = $settings->smtp_port; - $this->smtpEncryption = $settings->smtp_encryption; - $this->smtpUsername = $settings->smtp_username; - $this->smtpPassword = $settings->smtp_password; - $this->smtpTimeout = $settings->smtp_timeout; $this->resendEnabled = false; - $this->saveModel(); - - return; } + + $this->smtpRecipients = $settings->smtp_recipients; + $this->smtpHost = $settings->smtp_host; + $this->smtpPort = $settings->smtp_port; + $this->smtpEncryption = $settings->smtp_encryption; + $this->smtpUsername = $settings->smtp_username; + $this->smtpPassword = $settings->smtp_password; + $this->smtpTimeout = $settings->smtp_timeout; + if ($settings->resend_enabled) { $this->resendEnabled = true; - $this->resendApiKey = $settings->resend_api_key; $this->smtpEnabled = false; - $this->saveModel(); - - return; } - $this->dispatch('error', 'Instance SMTP/Resend settings are not enabled.'); + $this->resendApiKey = $settings->resend_api_key; + $this->saveModel(); + } public function render()