From 020fd96ef9d4c95814b40d569412ef8cab51896b Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Sat, 17 Jun 2023 09:03:00 +0200 Subject: [PATCH] [Email] Added email sender name --- application/controllers/Options.php | 12 ++++++++++-- application/controllers/Oqrs.php | 4 ++-- application/controllers/User.php | 2 +- application/language/english/options_lang.php | 3 +++ application/language/german/options_lang.php | 4 ++++ application/views/options/email.php | 7 +++++++ 6 files changed, 27 insertions(+), 5 deletions(-) diff --git a/application/controllers/Options.php b/application/controllers/Options.php index 1c503663..21a74b60 100644 --- a/application/controllers/Options.php +++ b/application/controllers/Options.php @@ -232,10 +232,18 @@ 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 + // Update email sender name within the options system + $emailSenderNameupdate = $this->optionslib->update('emailSenderName', $this->input->post('emailSenderName'), 'yes'); + + // If email address update is complete set a flashsession with a success note + if($emailSenderNameupdate == TRUE) { + $this->session->set_flashdata('success', $this->lang->line('options_email_sender_name_changed_to').$this->input->post('emailSenderName')); + } + + // Update email address 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 email address 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')); } diff --git a/application/controllers/Oqrs.php b/application/controllers/Oqrs.php index fe8411ce..bc7ce099 100644 --- a/application/controllers/Oqrs.php +++ b/application/controllers/Oqrs.php @@ -181,8 +181,8 @@ class Oqrs extends CI_Controller { $data['usermessage'] = $this->security->xss_clean($postdata['message']); $message = $this->load->view('email/oqrs_request', $data, TRUE); - - $this->email->from($this->optionslib->get_option('emailAddress'), 'Cloudlog OQRS'); + + $this->email->from($this->optionslib->get_option('emailAddress'), $this->optionslib->get_option('emailSenderName')); $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 ca2aedef..2d89e0ad 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($this->optionslib->get_option('emailAddress'), 'Cloudlog'); + $this->email->from($this->optionslib->get_option('emailAddress'), $this->optionslib->get_option('emailSenderName')); $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 a99702d8..af31fe80 100644 --- a/application/language/english/options_lang.php +++ b/application/language/english/options_lang.php @@ -33,6 +33,7 @@ $lang['options_email'] = 'Email'; $lang['options_outgoing_protocol'] = 'Outgoing Protocol'; $lang['options_smtp_encryption'] = 'SMTP Encryption'; $lang['options_email_address'] = 'Email Address'; +$lang['options_email_sender_name'] = 'Email Sender Name'; $lang['options_smtp_host'] = 'SMTP Host'; $lang['options_smtp_port'] = 'SMTP Port'; $lang['options_smtp_username'] = 'SMTP Username'; @@ -41,6 +42,8 @@ $lang['options_crlf'] = 'CRLF'; $lang['options_newline'] = 'Newline'; $lang['options_outgoing_email_protocol_changed_to'] = 'Outgoing Email Protocol changed to '; $lang['options_smtp_encryption_changed_to'] = 'SMTP Encryption changed to '; +$lang['options_email_address_changed_to'] = 'Email Address changed to '; +$lang['options_email_sender_name_changed_to'] = 'Email Sender Name changed to '; $lang['options_smtp_host_changed_to'] = 'SMTP Host changed to '; $lang['options_smtp_port_changed_to'] = 'SMTP Post changed to '; $lang['options_smtp_username_changed_to'] = 'SMTP Username changed to '; diff --git a/application/language/german/options_lang.php b/application/language/german/options_lang.php index 71c15b37..50032646 100644 --- a/application/language/german/options_lang.php +++ b/application/language/german/options_lang.php @@ -32,6 +32,8 @@ $lang['options_radio_timeout_warning_changed_to'] = 'Radio Timeout Warnung geän $lang['options_email'] = 'Email'; $lang['options_outgoing_protocol'] = 'Protokoll für ausgehende Emails'; $lang['options_smtp_encryption'] = 'SMTP Verschlüsselung'; +$lang['options_email_address'] = 'Emailaddresse'; +$lang['options_email_sender_name'] = 'Email Absendername'; $lang['options_smtp_host'] = 'SMTP Host'; $lang['options_smtp_port'] = 'SMTP Port'; $lang['options_smtp_username'] = 'SMTP Benutzername'; @@ -40,6 +42,8 @@ $lang['options_crlf'] = 'CRLF'; $lang['options_newline'] = 'Zeilenvorschub'; $lang['options_outgoing_email_protocol_changed_to'] = 'Protokoll für ausgehende Emails geändert zu '; $lang['options_smtp_encryption_changed_to'] = 'SMTP Verschlüsselung geändert zu '; +$lang['options_email_address_changed_to'] = 'Emailadresse geändert zu '; +$lang['options_email_sender_name_changed_to'] = 'Email Absendername geändert zu '; $lang['options_smtp_host_changed_to'] = 'SMTP Host geändert zu '; $lang['options_smtp_port_changed_to'] = 'SMTP Post changed to '; $lang['options_smtp_username_changed_to'] = 'SMTP Benutzername geändert zu '; diff --git a/application/views/options/email.php b/application/views/options/email.php index b69e3076..c62fcc3b 100644 --- a/application/views/options/email.php +++ b/application/views/options/email.php @@ -51,6 +51,13 @@ +
+ +
+ optionslib->get_option('emailSenderName'); } ?>"> +
+
+