mirror of https://github.com/itflow-org/itflow
Update new mail queue function to use the proper mail from name and mail from email
This commit is contained in:
parent
cdaca0e06b
commit
e8a53cbd6a
2
ajax.php
2
ajax.php
|
|
@ -314,6 +314,8 @@ if (isset($_GET['share_generate_link'])) {
|
|||
|
||||
$data = [
|
||||
[
|
||||
'from' => $config_mail_from_email,
|
||||
'from_name' => $config_mail_from_name,
|
||||
'recipient' => $item_email,
|
||||
'recipient_name' => $item_email,
|
||||
'subject' => $subject,
|
||||
|
|
|
|||
12
cron.php
12
cron.php
|
|
@ -306,6 +306,8 @@ if (mysqli_num_rows($sql_scheduled_tickets) > 0) {
|
|||
$email_body = mysqli_real_escape_string($mysqli, "<i style='color: #808080'>##- Please type your reply above this line -##</i><br><br>Hello, $contact_name<br><br>A ticket regarding \"$ticket_subject\" has been automatically created for you.<br><br>--------------------------------<br>$details--------------------------------<br><br>Ticket: $ticket_prefix$ticket_number<br>Subject: $ticket_subject<br>Status: Open<br>Portal: https://$config_base_url/portal/ticket.php?id=$id<br><br>~<br>$company_name<br>Support Department<br>$config_ticket_from_email<br>$company_phone");
|
||||
|
||||
$email = [
|
||||
'from' => $config_ticket_from_email,
|
||||
'from_name' => $config_ticket_from_name,
|
||||
'recipient' => $contact_email_escaped,
|
||||
'recipient_name' => $contact_name_escaped,
|
||||
'subject' => $email_subject,
|
||||
|
|
@ -324,6 +326,8 @@ if (mysqli_num_rows($sql_scheduled_tickets) > 0) {
|
|||
$email_body = mysqli_real_escape_string($mysqli, "Hello, <br><br>This is a notification that a new scheduled ticket has been raised in ITFlow. <br>Ticket: $ticket_prefix$ticket_number<br>Client: $client_name<br>Priority: $priority<br>Link: https://$config_base_url/ticket.php?ticket_id=$id <br><br>--------------------------------<br><br><b>$ticket_subject</b><br>$ticket_details");
|
||||
|
||||
$email = [
|
||||
'from' => $config_ticket_from_email,
|
||||
'from_name' => $config_ticket_from_name,
|
||||
'recipient' => $config_ticket_new_ticket_notification_email,
|
||||
'recipient_name' => $config_ticket_from_name_escaped,
|
||||
'subject' => $email_subject,
|
||||
|
|
@ -428,6 +432,8 @@ if ($config_ticket_autoclose == 1) {
|
|||
|
||||
$data = [
|
||||
[
|
||||
'from' => $config_ticket_from_email,
|
||||
'from_name' => $config_ticket_from_name,
|
||||
'recipient' => $contact_email,
|
||||
'recipient_name' => $contact_name,
|
||||
'subject' => $subject,
|
||||
|
|
@ -509,6 +515,8 @@ if ($config_send_invoice_reminders == 1) {
|
|||
|
||||
$mail = addToMailQueue($mysqli, [
|
||||
[
|
||||
'from' => $config_invoice_from_email,
|
||||
'from_name' => $config_invoice_from_name,
|
||||
'recipient' => $contact_email,
|
||||
'recipient_name' => $contact_name,
|
||||
'subject' => $subject,
|
||||
|
|
@ -624,6 +632,8 @@ while ($row = mysqli_fetch_array($sql_recurring)) {
|
|||
|
||||
$mail = addToMailQueue($mysqli, [
|
||||
[
|
||||
'from' => $config_invoice_from_email,
|
||||
'from_name' => $config_invoice_from_name,
|
||||
'recipient' => $contact_email,
|
||||
'recipient_name' => $contact_name,
|
||||
'subject' => $subject,
|
||||
|
|
@ -657,6 +667,8 @@ while ($row = mysqli_fetch_array($sql_recurring)) {
|
|||
|
||||
$data = [
|
||||
[
|
||||
'from' => $config_invoice_from_email,
|
||||
'from_name' => $config_invoice_from_name,
|
||||
'recipient' => $billing_contact_email,
|
||||
'recipient_name' => $billing_contact_name,
|
||||
'subject' => $subject,
|
||||
|
|
|
|||
|
|
@ -169,6 +169,8 @@ function addTicket($contact_id, $contact_name, $contact_email, $client_id, $date
|
|||
$body_escaped = mysqli_escape_string($mysqli, "<i style='color: #808080'>##- Please type your reply above this line -##</i><br><br>Hello, $contact_name<br><br>Thank you for your email. A ticket regarding \"$subject\" has been automatically created for you.<br><br>Ticket: $config_ticket_prefix$ticket_number<br>Subject: $subject<br>Status: Open<br>https://$config_base_url/portal/ticket.php?id=$id<br><br>~<br>$company_name<br>Support Department<br>$config_ticket_from_email<br>$company_phone");
|
||||
|
||||
$data[] = [
|
||||
'from' => $config_ticket_from_email,
|
||||
'from_name' => $config_ticket_from_name,
|
||||
'recipient' => $contact_email_escaped,
|
||||
'recipient_name' => $contact_name_escaped,
|
||||
'subject' => $subject_escaped,
|
||||
|
|
@ -191,6 +193,8 @@ function addTicket($contact_id, $contact_name, $contact_email, $client_id, $date
|
|||
$email_body = "Hello, <br><br>This is a notification that a new ticket has been raised in ITFlow. <br>Client: $client_name<br>Priority: Low (email parsed)<br>Link: https://$config_base_url/ticket.php?ticket_id=$id <br><br>--------------------------------<br><br><b>$subject</b><br>$details";
|
||||
|
||||
$data[] = [
|
||||
'from' => $config_ticket_from_email,
|
||||
'from_name' => $config_ticket_from_name,
|
||||
'recipient' => $config_ticket_new_ticket_notification_email,
|
||||
'recipient_name' => $config_ticket_from_name,
|
||||
'subject' => $email_subject,
|
||||
|
|
@ -243,6 +247,8 @@ function addReply($from_email, $date, $subject, $ticket_number, $message, $attac
|
|||
|
||||
$data = [
|
||||
[
|
||||
'from' => $config_ticket_from_email,
|
||||
'from_name' => $config_ticket_from_name,
|
||||
'recipient' => $from_email,
|
||||
'recipient_name' => $from_email,
|
||||
'subject' => $email_subject,
|
||||
|
|
@ -341,6 +347,8 @@ function addReply($from_email, $date, $subject, $ticket_number, $message, $attac
|
|||
|
||||
$data = [
|
||||
[
|
||||
'from' => $config_ticket_from_email,
|
||||
'from_name' => $config_ticket_from_name,
|
||||
'recipient' => $tech_email_escaped,
|
||||
'recipient_name' => $tech_name_escaped,
|
||||
'subject' => $subject_escaped,
|
||||
|
|
|
|||
|
|
@ -875,16 +875,16 @@ function calculateAccountBalance($mysqli, $account_id) {
|
|||
|
||||
|
||||
function addToMailQueue($mysqli, $data) {
|
||||
$config_invoice_from_email = strval(getSettingValue($mysqli, 'config_invoice_from_email'));
|
||||
$config_invoice_from_name = strval(getSettingValue($mysqli, 'config_invoice_from_name'));
|
||||
|
||||
|
||||
foreach ($data as $email) {
|
||||
$from = strval($email['from']);
|
||||
$from_name = strval($email['from_name']);
|
||||
$recipient = strval($email['recipient']);
|
||||
$recipient_name = strval($email['recipient_name']);
|
||||
$subject = strval($email['subject']);
|
||||
$body = strval($email['body']);
|
||||
|
||||
mysqli_query($mysqli, "INSERT INTO email_queue SET email_recipient = '$recipient', email_recipient_name = '$recipient_name', email_from = '$config_invoice_from_email', email_from_name = '$config_invoice_from_name', email_subject = '$subject', email_content = '$body'");
|
||||
mysqli_query($mysqli, "INSERT INTO email_queue SET email_recipient = '$recipient', email_recipient_name = '$recipient_name', email_from = '$from', email_from_name = '$from_name', email_subject = '$subject', email_content = '$body'");
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -346,6 +346,8 @@ if (isset($_GET['invoice_id'], $_GET['url_key']) && !isset($_GET['payment_intent
|
|||
|
||||
$data = [
|
||||
[
|
||||
'from' => $config_invoice_from_email,
|
||||
'from_name' => $config_invoice_from_name,
|
||||
'recipient' => $contact_email,
|
||||
'recipient_name' => $contact_name,
|
||||
'subject' => $subject,
|
||||
|
|
|
|||
|
|
@ -147,6 +147,8 @@ if (isset($_POST['login'])) {
|
|||
|
||||
$data = [
|
||||
[
|
||||
'from' => $config_mail_from_email,
|
||||
'from_name' => $config_mail_from_name,
|
||||
'recipient' => $user_email,
|
||||
'recipient_name' => $user_name,
|
||||
'subject' => $subject,
|
||||
|
|
@ -220,6 +222,8 @@ if (isset($_POST['login'])) {
|
|||
$body = "Hi $user_name, <br><br>A recent login to your $config_app_name account was unsuccessful due to an incorrect 2FA code. If you did not attempt this login, your credentials may be compromised. <br><br>Thanks, <br>ITFlow";
|
||||
$data = [
|
||||
[
|
||||
'from' => $config_mail_from_email,
|
||||
'from_name' => $config_mail_from_name,
|
||||
'recipient' => $user_email,
|
||||
'recipient_name' => $user_name,
|
||||
'subject' => $subject,
|
||||
|
|
|
|||
|
|
@ -680,6 +680,8 @@ if (isset($_POST['add_payment'])) {
|
|||
|
||||
// Queue Mail
|
||||
$email = [
|
||||
'from' => $config_invoice_from_email,
|
||||
'from_name' => $config_invoice_from_name,
|
||||
'recipient' => $contact_email_escaped,
|
||||
'recipient_name' => $contact_name_escaped,
|
||||
'subject' => $subject,
|
||||
|
|
@ -711,6 +713,8 @@ if (isset($_POST['add_payment'])) {
|
|||
|
||||
// Queue Mail
|
||||
$email = [
|
||||
'from' => $config_invoice_from_email,
|
||||
'from_name' => $config_invoice_from_name,
|
||||
'recipient' => $contact_email_escaped,
|
||||
'recipient_name' => $contact_name_escaped,
|
||||
'subject' => $subject,
|
||||
|
|
@ -1002,6 +1006,8 @@ if (isset($_GET['email_invoice'])) {
|
|||
// Queue Mail
|
||||
$data = [
|
||||
[
|
||||
'from' => $config_invoice_from_email_escaped,
|
||||
'from_name' => $config_invoice_from_name_escaped,
|
||||
'recipient' => $contact_email_escaped,
|
||||
'recipient_name' => $contact_name_escaped,
|
||||
'subject' => $subject,
|
||||
|
|
@ -1043,6 +1049,8 @@ if (isset($_GET['email_invoice'])) {
|
|||
|
||||
$data = [
|
||||
[
|
||||
'from' => $config_invoice_from_email,
|
||||
'from_name' => $config_invoice_from_name,
|
||||
'recipient' => $billing_contact_email,
|
||||
'recipient_name' => $billing_contact_name,
|
||||
'subject' => $subject,
|
||||
|
|
@ -1172,6 +1180,8 @@ if (isset($_GET['force_recurring'])) {
|
|||
|
||||
$data = [
|
||||
[
|
||||
'from' => $config_invoice_from_email,
|
||||
'from_name' => $config_invoice_from_name,
|
||||
'recipient' => $contact_email,
|
||||
'recipient_name' => $contact_name,
|
||||
'subject' => $subject,
|
||||
|
|
|
|||
|
|
@ -397,6 +397,8 @@ if (isset($_GET['email_quote'])) {
|
|||
// Queue Mail
|
||||
$data = [
|
||||
[
|
||||
'from' => $config_quote_from_email,
|
||||
'from_name' => $config_quote_from_name,
|
||||
'recipient' => $contact_email_escaped,
|
||||
'recipient_name' => $contact_name_escaped,
|
||||
'subject' => $subject,
|
||||
|
|
|
|||
|
|
@ -158,6 +158,8 @@ if (isset($_POST['test_email_smtp'])) {
|
|||
|
||||
$data = [
|
||||
[
|
||||
'from' => $email_from,
|
||||
'from_name' => $email_from,
|
||||
'recipient' => $email_to,
|
||||
'recipient_name' => 'Chap',
|
||||
'subject' => $subject,
|
||||
|
|
|
|||
|
|
@ -121,6 +121,8 @@ if (isset($_POST['add_ticket'])) {
|
|||
// Queue Mail
|
||||
$data = [
|
||||
[
|
||||
'from' => $config_ticket_from_email,
|
||||
'from_name' => $config_ticket_from_name,
|
||||
'recipient' => $contact_email_escaped,
|
||||
'recipient_name' => $contact_name_escaped,
|
||||
'subject' => $subject_escaped,
|
||||
|
|
@ -137,6 +139,8 @@ if (isset($_POST['add_ticket'])) {
|
|||
// Queue Mail
|
||||
$data = [
|
||||
[
|
||||
'from' => $config_ticket_from_email,
|
||||
'from_name' => $config_ticket_from_name,
|
||||
'recipient' => $watcher_email_escaped,
|
||||
'recipient_name' => $watcher_email_escaped,
|
||||
'subject' => $subject_escaped,
|
||||
|
|
@ -424,6 +428,8 @@ if (isset($_POST['assign_ticket'])) {
|
|||
// Queue Mail
|
||||
$data = [
|
||||
[
|
||||
'from' => $config_ticket_from_email,
|
||||
'from_name' => $config_ticket_from_name,
|
||||
'recipient' => $agent_email_escaped,
|
||||
'recipient_name' => $agent_name_escaped,
|
||||
'subject' => $subject_escaped,
|
||||
|
|
@ -576,6 +582,8 @@ if (isset($_POST['add_ticket_reply'])) {
|
|||
// Email Ticket Contact
|
||||
// Queue Mail
|
||||
$data[] = [
|
||||
'from' => $config_ticket_from_email,
|
||||
'from_name' => $config_ticket_from_name,
|
||||
'recipient' => $contact_email_escaped,
|
||||
'recipient_name' => $contact_name_escaped,
|
||||
'subject' => $subject_escaped,
|
||||
|
|
@ -590,6 +598,8 @@ if (isset($_POST['add_ticket_reply'])) {
|
|||
|
||||
// Queue Mail
|
||||
$data[] = [
|
||||
'from' => $config_ticket_from_email,
|
||||
'from_name' => $config_ticket_from_name,
|
||||
'recipient' => $watcher_email_escaped,
|
||||
'recipient_name' => $watcher_email_escaped,
|
||||
'subject' => $subject_escaped,
|
||||
|
|
@ -798,6 +808,8 @@ if (isset($_GET['close_ticket'])) {
|
|||
// Queue Mail
|
||||
|
||||
$data[] = [
|
||||
'from' => $config_ticket_from_email,
|
||||
'from_name' => $config_ticket_from_name,
|
||||
'recipient' => $contact_email_escaped,
|
||||
'recipient_name' => $contact_name_escaped,
|
||||
'subject' => $subject_escaped,
|
||||
|
|
@ -812,6 +824,8 @@ if (isset($_GET['close_ticket'])) {
|
|||
|
||||
// Queue Mail
|
||||
$data[] = [
|
||||
'from' => $config_ticket_from_email,
|
||||
'from_name' => $config_ticket_from_name,
|
||||
'recipient' => $watcher_email_escaped,
|
||||
'recipient_name' => $watcher_email_escaped,
|
||||
'subject' => $subject_escaped,
|
||||
|
|
|
|||
Loading…
Reference in New Issue