[rt-users] Initial Queue Detection
Meo, Anthony
Anthony.Meo at btci.com
Tue Apr 5 00:10:35 EDT 2005
Now I understand. I'll try to help but I'm not in a position
to test my suggestions right now so you'll have to test them
and get back to me.
First, I think we can change the From address for all emails
by adding a From header to each template.
Go to: Configuration->Global->Templates
and add a From line to the top of each template, like this example:
==== Template Correspondence =======
From: <makeupsomeaddress at yourcompany.com>
RT-Attach-Message: yes
{$Transaction->Content()}
==== END of Template =====
The blank line between the headers is important. Now send
and e-mail by replying to a ticket and make sure the From
address is the one you added and not the one for the
queue.
Next, we want to write a function that gets the correspond
address of a ticket based on the first queue.
==== File /opt/rt3/local/lib/RT/Ticket_Local.pm ====
use strict;
no warnings qw(redefine);
sub FirstQueueEmail {
my $self = shift;
my $email = $self->QueueObj->CorrespondAddress;
my $transactions = $self->Transactions;
$transactions->Limit( FIELD => 'Type', VALUE => 'Set' );
$transactions->Limit( FIELD => 'Field', VALUE => 'Queue' );
if ( $transactions->Count ) {
my $queue_id = $transactions->First->OldValue;
my $queue = RT::Queue->new( $RT::SystemUser );
my ($rv, $msg) = $queue->Load($queue_id);
$email = $queue->CorrespondAddress if $rv;
}
return $email;
}
1;
==== END File ====
Finally, if the header tests in the rist step worked, change the
from line to:
From: { $Ticket->FirstQueueEmail }
Let me know if you have problems.
-Todd
[[Anthony Meo]]
This sounds like a viable option I will use your code a start for this
and then provide some feedback on this all as to how it works out and
any other mods I make.
If anyone has any thoughts on the idea of making this into a "Branding
Engine" of sorts, please keep this discussion going. Whatever the final
method of implementation is, I will be creating configuration pages (if
necessary to get this to be fully usable in a production environment.
Best,
-Anthony
More information about the rt-users
mailing list