[rt-users] Different signature per queue
Emmanuel Lacour
elacour at easter-eggs.com
Wed Nov 9 03:46:54 EST 2016
Le 08/11/2016 à 11:18, John Angel a écrit :
> Trying to make different signature per queue. Don't want to use templates
> but $SignatureAboveQuote.
>
Here I use the callback
rt/local/html/Callbacks/MyCompany/Elements/MessageBox/Default with the
following content:
<%INIT>
# Use queue template "Signature" as signature if any, overwise, use the
currentuser's one
if ( $id ) {
my $SystemTicket = RT::Ticket->new( $RT::SystemUser );
$SystemTicket->Load( $id );
my $QueueSignature = RT::Template->new( $RT::SystemUser );
my ($val, $msg) = $QueueSignature->LoadQueueTemplate( Queue =>
$SystemTicket->QueueObj->Id, Name => 'Signature' );
if ( $val && $QueueSignature->Content ) {
my ($queue_signature, ) =
$QueueSignature->_ParseContent(TicketObj => $SystemTicket);
$queue_signature =~ s!^\s*Content-Type\s*:\s+(.*)\s*$!!mi;
my $ContentType = $1 || ' text/plain';
if ( $ContentType eq 'text/html' ) {
$$SignatureRef = "-- <br />" . $queue_signature;
} else {
$$SignatureRef = "-- \n" . $queue_signature;
}
} else {
$RT::Logger->info("Unable to load queue template
signature: $msg");
}
}
</%INIT>
<%ARGS>
$SignatureRef => undef
$id => undef
</%ARGS>
you need to setup a template named "Signature" on queue where you wan't
queue signature, then the above code will use this signature in place of
user one.
If you don't wan't to use a template, you can use above code as example
to access ticket queue name.
(it's on RT 4.2, but should work on 4.4)
More information about the rt-users
mailing list