mirror of
https://github.com/itflow-org/itflow
synced 2026-06-25 19:21:07 +00:00
Mail: Update mail configuration check to use smtp_provider instead of smtp_host as host is blank upon using oath2
This commit is contained in:
@@ -111,7 +111,7 @@ if (isset($_POST['add_ticket'])) {
|
||||
}
|
||||
|
||||
// E-mail client
|
||||
if ((!empty($config_smtp_host) || !empty($config_smtp_provider)) && $config_ticket_client_general_notifications == 1) {
|
||||
if ((!empty($config_smtp_provider) || !empty($config_smtp_provider)) && $config_ticket_client_general_notifications == 1) {
|
||||
|
||||
// Get contact/ticket details
|
||||
$sql = mysqli_query($mysqli, "SELECT contact_name, contact_email, ticket_prefix, ticket_number, ticket_category, ticket_subject, ticket_details, ticket_priority, ticket_status, ticket_created_by, ticket_assigned_to, ticket_client_id FROM tickets
|
||||
@@ -273,7 +273,7 @@ if (isset($_POST['edit_ticket'])) {
|
||||
$client_id = intval($row['ticket_client_id']);
|
||||
|
||||
// Notify new contact if selected
|
||||
if ($notify && (!empty($config_smtp_host) || !empty($config_smtp_provider))) {
|
||||
if ($notify && (!empty($config_smtp_provider) || !empty($config_smtp_provider))) {
|
||||
|
||||
// Get Company Name Phone Number and Sanitize for Email Sending
|
||||
$sql = mysqli_query($mysqli, "SELECT company_name, company_phone, company_phone_country_code FROM companies WHERE company_id = 1");
|
||||
@@ -406,7 +406,7 @@ if (isset($_POST['edit_ticket_contact'])) {
|
||||
$contact_email = sanitizeInput($row['contact_email']);
|
||||
|
||||
// Notify new contact (if selected, valid & configured)
|
||||
if ($notify && filter_var($contact_email, FILTER_VALIDATE_EMAIL) && (!empty($config_smtp_host) || !empty($config_smtp_provider))) {
|
||||
if ($notify && filter_var($contact_email, FILTER_VALIDATE_EMAIL) && (!empty($config_smtp_provider) || !empty($config_smtp_provider))) {
|
||||
|
||||
// Get Company Phone Number
|
||||
$sql = mysqli_query($mysqli, "SELECT company_name, company_phone, company_phone_country_code FROM companies WHERE company_id = 1");
|
||||
@@ -530,7 +530,7 @@ if (isset($_POST['add_ticket_watcher'])) {
|
||||
mysqli_query($mysqli, "INSERT INTO ticket_watchers SET watcher_email = '$watcher_email', watcher_ticket_id = $ticket_id");
|
||||
|
||||
// Notify watcher
|
||||
if ($notify && (!empty($config_smtp_host) || !empty($config_smtp_provider))) {
|
||||
if ($notify && (!empty($config_smtp_provider))) {
|
||||
|
||||
|
||||
|
||||
@@ -813,7 +813,7 @@ if (isset($_POST['assign_ticket'])) {
|
||||
mysqli_query($mysqli, "INSERT INTO notifications SET notification_type = 'Ticket', notification = 'Ticket $ticket_prefix$ticket_number - Subject: $ticket_subject has been assigned to you by $session_name', notification_action = '/agent/ticket.php?ticket_id=$ticket_id$client_uri', notification_client_id = $client_id, notification_user_id = $assigned_to");
|
||||
|
||||
// Email Notification
|
||||
if (!empty($config_smtp_host) || !empty($config_smtp_provider)) {
|
||||
if (!empty($config_smtp_provider)) {
|
||||
|
||||
// Sanitize Config vars from get_settings.php
|
||||
$config_ticket_from_name = sanitizeInput($config_ticket_from_name);
|
||||
@@ -1025,7 +1025,7 @@ if (isset($_POST['bulk_assign_ticket'])) {
|
||||
mysqli_query($mysqli, "INSERT INTO notifications SET notification_type = 'Ticket', notification = '$ticket_count Tickets have been assigned to you by $session_name', notification_action = 'tickets.php?status=Open&assigned=$assign_to', notification_client_id = $client_id, notification_user_id = $assign_to");
|
||||
|
||||
// Agent Email Notification
|
||||
if (!empty($config_smtp_host) || !empty($config_smtp_provider)) {
|
||||
if (!empty($config_smtp_provider)) {
|
||||
|
||||
// Sanitize Config vars from get_settings.php
|
||||
$config_ticket_from_name = sanitizeInput($config_ticket_from_name);
|
||||
@@ -1300,7 +1300,7 @@ if (isset($_POST['bulk_resolve_tickets'])) {
|
||||
customAction('ticket_resolve', $ticket_id);
|
||||
|
||||
// Client notification email
|
||||
if ((!empty($config_smtp_host) || !empty($config_smtp_provider)) && $config_ticket_client_general_notifications == 1 && $private_note == 0) {
|
||||
if ((!empty($config_smtp_provider)) && $config_ticket_client_general_notifications == 1 && $private_note == 0) {
|
||||
|
||||
// Get Contact details
|
||||
$ticket_sql = mysqli_query($mysqli, "SELECT contact_name, contact_email FROM tickets
|
||||
@@ -1486,7 +1486,7 @@ if (isset($_POST['bulk_ticket_reply'])) {
|
||||
$company_phone = sanitizeInput(formatPhoneNumber($row['company_phone'], $row['company_phone_country_code']));
|
||||
|
||||
// Send e-mail to client if public update & email is set up
|
||||
if ($private_note == 0 && (!empty($config_smtp_host) || !empty($config_smtp_provider))) {
|
||||
if ($private_note == 0 && (!empty($config_smtp_provider))) {
|
||||
|
||||
$subject = "Ticket update - [$ticket_prefix$ticket_number] - $ticket_subject";
|
||||
$body = "<i style=\'color: #808080\'>##- Please type your reply above this line -##</i><br><br>Hello $contact_name,<br><br>Your ticket regarding $ticket_subject has been updated.<br><br>--------------------------------<br>$ticket_reply<br>--------------------------------<br><br>Ticket: $ticket_prefix$ticket_number<br>Subject: $ticket_subject<br>Status: $ticket_status_name<br>Portal: <a href=\'https://$config_base_url/guest/guest_view_ticket.php?ticket_id=$ticket_id&url_key=$url_key\'>View ticket</a><br><br>--<br>$company_name - Support<br>$from_email<br>$company_phone";
|
||||
@@ -1822,7 +1822,7 @@ if (isset($_POST['add_ticket_reply'])) {
|
||||
$company_phone = sanitizeInput(formatPhoneNumber($row['company_phone'], $row['company_phone_country_code']));
|
||||
|
||||
// Send e-mail to client if public update & email is set up
|
||||
if ($ticket_reply_type == 'Public' && $send_email == 1 && (!empty($config_smtp_host) || !empty($config_smtp_provider))) {
|
||||
if ($ticket_reply_type == 'Public' && $send_email == 1 && (!empty($config_smtp_provider))) {
|
||||
|
||||
// Slightly different email subject/text depending on if this update set auto-close
|
||||
|
||||
@@ -2131,7 +2131,7 @@ if (isset($_GET['resolve_ticket'])) {
|
||||
customAction('ticket_resolve', $ticket_id);
|
||||
|
||||
// Client notification email
|
||||
if ((!empty($config_smtp_host) || !empty($config_smtp_provider)) && $config_ticket_client_general_notifications == 1) {
|
||||
if ((!empty($config_smtp_provider)) && $config_ticket_client_general_notifications == 1) {
|
||||
|
||||
// Get details
|
||||
$ticket_sql = mysqli_query($mysqli, "SELECT contact_name, contact_email, ticket_prefix, ticket_number, ticket_subject, ticket_status_name, ticket_assigned_to, ticket_url_key FROM tickets
|
||||
@@ -2233,7 +2233,7 @@ if (isset($_GET['close_ticket'])) {
|
||||
customAction('ticket_close', $ticket_id);
|
||||
|
||||
// Client notification email
|
||||
if ((!empty($config_smtp_host) || !empty($config_smtp_provider)) && $config_ticket_client_general_notifications == 1) {
|
||||
if ((!empty($config_smtp_provider)) && $config_ticket_client_general_notifications == 1) {
|
||||
|
||||
// Get details
|
||||
$ticket_sql = mysqli_query($mysqli, "SELECT contact_name, contact_email, ticket_prefix, ticket_number, ticket_subject, ticket_url_key FROM tickets
|
||||
|
||||
Reference in New Issue
Block a user