From 4bfbd98448541518acab7c89a7edb22e888156dc Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Mon, 11 May 2015 10:06:25 -0500
Subject: [PATCH] email: Add warning to ticket view page

If the email address in use by the end user is not valid, display a warning
on the ticket view page. This allows an agent to easily flag potential spam
or correct a legitimate email address before sending a response and
receiving a bounce notice.
---
 include/staff/ticket-view.inc.php | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/staff/ticket-view.inc.php b/include/staff/ticket-view.inc.php
index 68443b69e..138b0af4c 100644
--- a/include/staff/ticket-view.inc.php
+++ b/include/staff/ticket-view.inc.php
@@ -42,6 +42,8 @@ if (!$errors['err']) {
                 $lock->getStaffName());
     elseif (($emailBanned=TicketFilter::isBanned($ticket->getEmail())))
         $errors['err'] = __('Email is in banlist! Must be removed before any reply/response');
+    elseif (!Validator::is_valid_email($ticket->getEmail()))
+        $errors['err'] = __('EndUser email address is not valid! Consider updating it before responding');
 }
 
 $unbannable=($emailBanned) ? BanList::includes($ticket->getEmail()) : false;
-- 
GitLab