We had a few cases where we didn't want the user notified when a ticket was created via email and when a ticket was updated. For example if we have a data line go down Verizon Buisness emails our helpdesk to notify of the outage, TTX then emails the reply about the ticket being received. Then Verizon bounces the email with an autoresponse that it's an unmonitored account and the message gets added to the ticket. Have something like this? If so here is an email filter. I'm new to Perl but i've tested and used this MOD in vers 2.24 for a week now and works great.
As always backup your files before you edit!In TTXTicket.pm - usernotify routine, find the following and ADD the part in red...
if ($cfg->get('sendfiles.customer')) {
$files = TTXData::get('SESSIONFILES');
}
if ($cfg->get('emailfilter')) {
my @filterlist = split(/\|/, $cfg->get('emailfilter'));
if (@filterlist ne undef) {
foreach my $mailfilter (@filterlist) {
if ($email eq $mailfilter) {
goto skipsendmail;
}
}
}
}
TTXMail::sendmail(
{
to => $email,
from => $fromaddr,
subject => $subject,
msg => $tmpl,
files => $files
}
);
skipsendmail:
if ($cfg->get('emaillist') ne undef) {
Also in TTXTicket.pm - usernotify routine, find the following and ADD the part in red...
$tmpltmp =~ s/\[%([^]]+)%\]/TTXDictionary::translate($1)/ge;
if ($cfg->get('emailfilter')) {
my @filterlist = split(/\|/, $cfg->get('emailfilter'));
if (@filterlist ne undef) {
foreach my $mailfilter (@filterlist) {
if ($addr eq $mailfilter) {
goto skipsendmail1;
}
}
}
}
TTXMail::sendmail(
{
to => $addr,
from => $fromaddr,
subject => $subject,
msg => $tmpltmp,
files => $files
}
);
skipsendmail1:
In ttxcfg.cgi add the following. Just add in the emails you want filtered seperated by |
emailfilter=skip.email@email.com|skip.metoo@email.com
If there was a better way I'd love to hear about it since I'm still learning Perl!
Edit by Sparky: Pnolette says this was tested in TTX v2.24 however it looks like it should work in any version of TTX including 3.0