Remove any "Send Single Email" declarations except in mail queue.

All emails go through the mail queue, using the addToMailQueue() function.
This commit is contained in:
o-psi
2023-12-19 23:02:05 +00:00
parent 70a9120147
commit 98f731b4d4
11 changed files with 168 additions and 149 deletions

View File

@@ -53,10 +53,15 @@ if (isset($_POST['add_user'])) {
$subject = "Your new $session_company_name ITFlow account";
$body = "Hello, $name<br><br>An ITFlow account has been setup for you. Please change your password upon login. <br><br>Username: $email <br>Password: $_POST[password]<br>Login URL: https://$config_base_url/login.php?key=$config_login_key_secret<br><br>~<br>$session_company_name<br>Support Department<br>$config_ticket_from_email";
$mail = sendSingleEmail($config_smtp_host, $config_smtp_username, $config_smtp_password, $config_smtp_encryption, $config_smtp_port,
$config_ticket_from_email, $config_ticket_from_name,
$email, $name,
$subject, $body);
$data = [
[
'recipient' => $email,
'recipient_name' => $name,
'subject' => $subject,
'body' => $body
]
];
$mail = addToMailQueue($mysqli, $data);
if ($mail !== true) {
mysqli_query($mysqli, "INSERT INTO notifications SET notification_type = 'Mail', notification = 'Failed to send email to $email'");