Added Email Client to ticket details, Public Comment does not email the client or watchers anything, but can view it in the ticker portal

This commit is contained in:
johnnyq 2024-05-30 16:36:38 -04:00
parent 237ba1dd20
commit 2149a33bd5
2 changed files with 19 additions and 5 deletions

View File

@ -1105,9 +1105,14 @@ if (isset($_POST['add_ticket_reply'])) {
$client_id = intval($_POST['client_id']);
$send_email = 0;
if ($_POST['public_reply_type'] == 1 ){
$ticket_reply_type = 'Public';
} else {
} elseif ($_POST['public_reply_type'] == 2 ) {
$ticket_reply_type = 'Public';
$send_email = 1;
} else {
$ticket_reply_type = 'Internal';
}
@ -1157,7 +1162,7 @@ if (isset($_POST['add_ticket_reply'])) {
$company_phone = sanitizeInput(formatPhoneNumber($row['company_phone']));
// Send e-mail to client if public update & email is set up
if ($ticket_reply_type == 'Public' && !empty($config_smtp_host)) {
if ($ticket_reply_type == 'Public' && $send_email == 1 && !empty($config_smtp_host)) {
if (filter_var($contact_email, FILTER_VALIDATE_EMAIL)) {

View File

@ -544,6 +544,9 @@ if (isset($_GET['ticket_id'])) {
<label class="btn btn-light">
<input type="radio" name="public_reply_type" value="0">Internal Note
</label>
<label class="btn btn-light mx-auto">
<input type="radio" class="float-right" name="public_reply_type" value="2">Email Client
</label>
</div>
<?php if ($config_ai_enable) { ?>
<div class="float-right">
@ -583,7 +586,7 @@ if (isset($_GET['ticket_id'])) {
<!-- Time Tracking -->
<div class="col-md-6">
<div class="input-group mb-3">
<div class="input-group px-0 col-2">
<div class="input-group pr-0 col-2">
<input type="text" class="form-control" inputmode="numeric" id="hours" name="hours" placeholder="Hrs" min="0" max="23" pattern="0?[0-9]|1[0-9]|2[0-3]">
</div>
@ -604,7 +607,7 @@ if (isset($_GET['ticket_id'])) {
<div class="col-md-2">
<div class="float-right">
<button type="submit" id="ticket_add_reply" name="add_ticket_reply" class="btn btn-primary text-bold"><i class="fas fa-check mr-2"></i>Submit</button>
<button type="submit" id="ticket_add_reply" name="add_ticket_reply" class="btn btn-primary btn-block text-bold"><i class="fas fa-check mr-2"></i>Submit</button>
</div>
</div>
@ -630,10 +633,16 @@ if (isset($_GET['ticket_id'])) {
</li>
<li class="nav-item">
<button class="nav-link" id="notes-tab" data-toggle="tab" data-target="#notes" type="button">
Notes
Internal Notes
<span class="right badge badge-pill badge-dark ml-2"><?php echo $ticket_internal_notes_count; ?></span>
</button>
</li>
<li class="nav-item">
<button class="nav-link" id="public-comments-tab" data-toggle="tab" data-target="#publicComments" type="button">
Client Communication
<span class="right badge badge-pill badge-dark ml-2"><?php echo $ticket_public_comments_count; ?></span>
</button>
</li>
<li class="nav-item ml-auto">
<button class="nav-link" id="events-tab" data-toggle="tab" data-target="#events" type="button">
Events