diff --git a/ajax.php b/ajax.php
index c36bf475..085f0702 100644
--- a/ajax.php
+++ b/ajax.php
@@ -364,7 +364,7 @@ if (isset($_GET['share_generate_link'])) {
]
];
- addToMailQueue($mysqli, $data);
+ addToMailQueue($data);
}
diff --git a/cron.php b/cron.php
index 9504a6b6..21434f9a 100644
--- a/cron.php
+++ b/cron.php
@@ -363,7 +363,7 @@ if (mysqli_num_rows($sql_scheduled_tickets) > 0) {
}
// Add to the mail queue
- addToMailQueue($mysqli, $data);
+ addToMailQueue($data);
// Set the next run date
if ($frequency == "weekly") {
@@ -487,7 +487,7 @@ if ($config_send_invoice_reminders == 1) {
Kindly review the invoice details mentioned below.
Invoice: $invoice_prefix$invoice_number
Issue Date: $invoice_date
Total: " . numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code) . "
Due Date: $invoice_due
Over Due By: $day Days
To view your invoice, please click here.
--
$company_name - Billing
$config_invoice_from_email
$company_phone";
- $mail = addToMailQueue($mysqli, [
+ $mail = addToMailQueue([
[
'from' => $config_invoice_from_email,
'from_name' => $config_invoice_from_name,
@@ -496,7 +496,7 @@ if ($config_send_invoice_reminders == 1) {
'subject' => $subject,
'body' => $body
]
- ]);
+ ]);
if ($mail === true) {
mysqli_query($mysqli, "INSERT INTO history SET history_status = 'Sent', history_description = 'Cron Emailed Overdue Invoice', history_invoice_id = $invoice_id");
@@ -619,7 +619,7 @@ while ($row = mysqli_fetch_array($sql_recurring)) {
$subject = "Invoice $invoice_prefix$invoice_number";
$body = "Hello $contact_name,
An invoice regarding \"$invoice_scope\" has been generated. Please view the details below.
Invoice: $invoice_prefix$invoice_number
Issue Date: $invoice_date
Total: " . numfmt_format_currency($currency_format, $invoice_amount, $recurring_currency_code) . "
Due Date: $invoice_due
To view your invoice, please click here.
--
$company_name - Billing
$config_invoice_from_email
$company_phone";
- $mail = addToMailQueue($mysqli, [
+ $mail = addToMailQueue([
[
'from' => $config_invoice_from_email,
'from_name' => $config_invoice_from_name,
@@ -666,7 +666,7 @@ while ($row = mysqli_fetch_array($sql_recurring)) {
]
];
- addToMailQueue($mysqli, $data);
+ addToMailQueue($data);
}
} //End if Autosend is on
diff --git a/cron_ticket_email_parser.php b/cron_ticket_email_parser.php
index e8b3e637..69daefbc 100644
--- a/cron_ticket_email_parser.php
+++ b/cron_ticket_email_parser.php
@@ -187,7 +187,7 @@ function addTicket($contact_id, $contact_name, $contact_email, $client_id, $date
];
}
- addToMailQueue($mysqli, $data);
+ addToMailQueue($data);
// Custom action/notif handler
customAction('ticket_create', $id);
@@ -249,7 +249,7 @@ function addReply($from_email, $date, $subject, $ticket_number, $message, $attac
]
];
- addToMailQueue($mysqli, $data);
+ addToMailQueue($data);
return true;
}
@@ -319,7 +319,7 @@ function addReply($from_email, $date, $subject, $ticket_number, $message, $attac
]
];
- addToMailQueue($mysqli, $data);
+ addToMailQueue($data);
}
}
diff --git a/functions.php b/functions.php
index 1bcc9349..fd27e6a9 100644
--- a/functions.php
+++ b/functions.php
@@ -5,9 +5,7 @@ DEFINE("WORDING_ROLECHECK_FAILED", "You are not permitted to do that!");
// PHP Mailer Libs
require_once "plugins/PHPMailer/src/Exception.php";
-
require_once "plugins/PHPMailer/src/PHPMailer.php";
-
require_once "plugins/PHPMailer/src/SMTP.php";
// Initiate PHPMailer
@@ -1029,7 +1027,9 @@ function generateReadablePassword($security_level)
return $password;
}
-function addToMailQueue($mysqli, $data) {
+function addToMailQueue($data) {
+
+ global $mysqli;
foreach ($data as $email) {
$from = strval($email['from']);
diff --git a/guest/guest_ajax.php b/guest/guest_ajax.php
index efbc4868..9e01dfa7 100644
--- a/guest/guest_ajax.php
+++ b/guest/guest_ajax.php
@@ -10,9 +10,7 @@ require_once "../config.php";
// Set Timezone
require_once "../inc_set_timezone.php";
-
require_once "../functions.php";
-
require_once "../rfc6238.php";
diff --git a/guest/guest_footer.php b/guest/guest_footer.php
index bc6c1eb8..3db213d9 100644
--- a/guest/guest_footer.php
+++ b/guest/guest_footer.php
@@ -21,9 +21,7 @@
-
-