At Wednesday 9/13/2006 06:42 PM, Ole Craig wrote:
(3.6.0/mysql4/CentOS)
>From a template, how can I get at the value of a specific header in the
first email message in a ticket? I know how to get it in a scrip:
my $trans = $self->TransactionObj;
my $msgattr = $trans->Message->First;
my $headerval = $msgattr->GetHeader('X-MY-HEADER');
...but when I try to do that from template context I get this:
[Tue Sep 12 11:33:25 2006] [error]: Template parsing error: Can't call
method "TransactionObj" on an undefined value at template line 1.
Ole,
You get at objects a bit differently in templates - available to you
is $Ticket, $Transaction etc. So you can replace the first 2 lines
of your code above with:
my $msgattr = $Transaction->Message->First;
The global templates that come with RT are a good reference.
Good luck,
Steve
_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]
Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com