From bfcfad780bc1b4ae080c98814308883c8313b5cb Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Fri, 16 Jun 2023 10:56:06 +0200 Subject: [PATCH] [Email] Added email address option --- application/controllers/Options.php | 8 ++++++++ application/controllers/Oqrs.php | 2 +- application/controllers/User.php | 2 +- application/language/english/options_lang.php | 1 + application/views/options/email.php | 6 ++++++ 5 files changed, 17 insertions(+), 2 deletions(-) diff --git a/application/controllers/Options.php b/application/controllers/Options.php index 849f8d8a..1c503663 100644 --- a/application/controllers/Options.php +++ b/application/controllers/Options.php @@ -232,6 +232,14 @@ class Options extends CI_Controller { $this->session->set_flashdata('success', $this->lang->line('options_smtp_encryption_changed_to').$this->input->post('smtpEncryption')); } + // Update smtpHost choice within the options system + $emailAddressupdate = $this->optionslib->update('emailAddress', $this->input->post('emailAddress'), 'yes'); + + // If smtpHost update is complete set a flashsession with a success note + if($emailAddressupdate == TRUE) { + $this->session->set_flashdata('success', $this->lang->line('options_email_address_changed_to').$this->input->post('emailAddress')); + } + // Update smtpHost choice within the options system $smtpHostupdate = $this->optionslib->update('smtpHost', $this->input->post('smtpHost'), 'yes'); diff --git a/application/controllers/Oqrs.php b/application/controllers/Oqrs.php index 51d8522c..fe8411ce 100644 --- a/application/controllers/Oqrs.php +++ b/application/controllers/Oqrs.php @@ -182,7 +182,7 @@ class Oqrs extends CI_Controller { $message = $this->load->view('email/oqrs_request', $data, TRUE); - $this->email->from('noreply@cloudlog.co.uk', 'Cloudlog'); + $this->email->from($this->optionslib->get_option('emailAddress'), 'Cloudlog OQRS'); $this->email->to($email); $this->email->reply_to($this->security->xss_clean($postdata['email']), strtoupper($data['callsign'])); diff --git a/application/controllers/User.php b/application/controllers/User.php index bdddf958..ca2aedef 100644 --- a/application/controllers/User.php +++ b/application/controllers/User.php @@ -608,7 +608,7 @@ class User extends CI_Controller { $message = $this->load->view('email/forgot_password', $this->data, TRUE); - $this->email->from('noreply@cloudlog.co.uk', 'Cloudlog'); + $this->email->from($this->optionslib->get_option('emailAddress'), 'Cloudlog'); $this->email->to($this->input->post('email', true)); $this->email->subject('Cloudlog Account Password Reset'); diff --git a/application/language/english/options_lang.php b/application/language/english/options_lang.php index 4098192d..a99702d8 100644 --- a/application/language/english/options_lang.php +++ b/application/language/english/options_lang.php @@ -32,6 +32,7 @@ $lang['options_radio_timeout_warning_changed_to'] = 'Radio Timeout Warning chang $lang['options_email'] = 'Email'; $lang['options_outgoing_protocol'] = 'Outgoing Protocol'; $lang['options_smtp_encryption'] = 'SMTP Encryption'; +$lang['options_email_address'] = 'Email Address'; $lang['options_smtp_host'] = 'SMTP Host'; $lang['options_smtp_port'] = 'SMTP Port'; $lang['options_smtp_username'] = 'SMTP Username'; diff --git a/application/views/options/email.php b/application/views/options/email.php index 1204c1f3..b69e3076 100644 --- a/application/views/options/email.php +++ b/application/views/options/email.php @@ -51,6 +51,12 @@ +