Add checks for email subject and body before sending (#7881)

This commit is contained in:
Alex
2026-04-17 16:13:49 +00:00
committed by GitHub
parent 4d5d099169
commit 163cb0b372
2 changed files with 12 additions and 8 deletions
+6 -4
View File
@@ -592,11 +592,13 @@
} }
unset($sql, $parameters, $row); unset($sql, $parameters, $row);
//replace variables in email body if (!empty($email_subject) && !empty($email_body)) {
$email_body = str_replace('${domain}', $domain_name, $email_body); //replace variables in email body
$email_body = str_replace('${domain}', $domain_name, $email_body);
//send the email //send the email
send_email($user_email, $email_subject, $email_body, $eml_error); send_email($user_email, $email_subject, $email_body, $eml_error);
}
//build the user log array //build the user log array
$log_array['type'] = 'Password Changed'; $log_array['type'] = 'Password Changed';
+6 -4
View File
@@ -456,11 +456,13 @@
} }
unset($sql, $parameters, $row); unset($sql, $parameters, $row);
//replace variables in email body if (!empty($email_subject) && !empty($email_body)) {
$email_body = str_replace('${domain}', $domain_name, $email_body); //replace variables in email body
$email_body = str_replace('${domain}', $domain_name, $email_body);
//send the email //send the email
send_email($user_email, $email_subject, $email_body, $eml_error); send_email($user_email, $email_subject, $email_body, $eml_error);
}
//get the username //get the username
$sql = "select username from v_users "; $sql = "select username from v_users ";