From 3341374c603320ae995596c1c9ccd21f59648962 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Sat, 21 Mar 2026 15:46:23 +0100 Subject: [PATCH] fix club email with sendmail --- application/controllers/Club.php | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/application/controllers/Club.php b/application/controllers/Club.php index b736e2114..6ee7e67b1 100644 --- a/application/controllers/Club.php +++ b/application/controllers/Club.php @@ -203,22 +203,19 @@ class Club extends CI_Controller redirect('club/permissions/'.$club_id); } - if($this->optionslib->get_option('emailProtocol') == "smtp") { - $config = [ - 'protocol' => $this->optionslib->get_option('emailProtocol'), - 'smtp_crypto' => $this->optionslib->get_option('smtpEncryption'), - 'smtp_host' => $this->optionslib->get_option('smtpHost'), - 'smtp_port' => $this->optionslib->get_option('smtpPort'), - 'smtp_user' => $this->optionslib->get_option('smtpUsername'), - 'smtp_pass' => $this->optionslib->get_option('smtpPassword'), - 'crlf' => "\r\n", - 'newline' => "\r\n" - ]; - $this->email->initialize($config); - - } else { - log_message('error', "Club Notification; Can't notify user - Email settings not configured."); - $this->session->set_flashdata('error', __("Email settings not configured.")); + $config = [ + 'protocol' => $this->optionslib->get_option('emailProtocol'), + 'smtp_crypto' => $this->optionslib->get_option('smtpEncryption'), + 'smtp_host' => $this->optionslib->get_option('smtpHost'), + 'smtp_port' => $this->optionslib->get_option('smtpPort'), + 'smtp_user' => $this->optionslib->get_option('smtpUsername'), + 'smtp_pass' => $this->optionslib->get_option('smtpPassword'), + 'crlf' => "\r\n", + 'newline' => "\r\n" + ]; + if(!$this->email->initialize($config)) { + log_message('error', "Club Notification; Can't notify user - Email can't be initialized."); + $this->session->set_flashdata('error', __("Email can't be initialized. Check the email settings.")); redirect('club/permissions/'.$club_id); }