Re: Different signature per queue

Emmanuel Lacour <[email protected]>
Newsgroups gmane.comp.bug-tracking.request-tracker.user
Message-ID <[email protected]>
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)
---------
RT 4.4 and RTIR training sessions, and a new workshop day! https://bestpractical.com/training
* Los Angeles - January 9-11 2017
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.