New to creating templates

Hi-

I’m sorta new to creating my own templates and to RT in general. One thing I would like to do is create a custom template that has some perl embedded in it. The docs I found seem to indicate that I can use the Text::Template method of embedding perl, i.e., use ‘{}’ to surround the code block, but that does not seem to work. For a test, I just created a custom template with this (using Autoreplay as a example, but calling it “AutoTest”:

Greetings,

This message has been automatically generated in response to the
creation of a trouble ticket regarding:
"{$Ticket->Subject()}".

{print “This is a test\n”;}

                    Thank you,
                    {$Ticket->QueueObj->CorrespondAddress()}

{$Transaction->Content()}

When I receive the reply from this template, where it should be printing out “This is a test”, I just get “main::STDOUT”.

Thanks-
Chuck C.

Don’t get soaked. Take a quick peak at the forecast
with the Yahoo! Search weather shortcut.
http://tools.search.yahoo.com/shortcuts/#loc_weather

Try just having {“This is a test”}, instead of the print. From looking at my templates, whenever a variable needs to be printed, it’s just left bare on a line.

For example, how $resolved_message is printed in Request Tracker Wiki

Also note how {$Ticket->Subject}, {$Ticket->QueueObj->CorrespondAddress()}, and {Transaction->Content()} are all done without a print.From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Chuck Danger
Sent: Thursday, February 15, 2007 21:00
To: rt-users@lists.bestpractical.com
Subject: [rt-users] new to creating templates

Hi-

I’m sorta new to creating my own templates and to RT in general. One thing I would like to do is create a custom template that has some perl embedded in it. The docs I found seem to indicate that I can use the Text::Template method of embedding perl, i.e., use ‘{}’ to surround the code block, but that does not seem to work. For a test, I just created a custom template with this (using Autoreplay as a example, but calling it “AutoTest”:

Subject: AutoReply: {$Ticket->Subject}

Greetings,

This message has been automatically generated in response to the
creation of a trouble ticket regarding:
“{$Ticket->Subject()}”.

{print “This is a test\n”;}

                    Thank you,
                    {$Ticket->QueueObj->CorrespondAddress()}

{$Transaction->Content()}

When I receive the reply from this template, where it should be printing out “This is a test”, I just get “main::STDOUT”.

Thanks-
Chuck C.

Don’t get soaked. Take a quick peak at the forecast
with theYahoo! Search weather shortcut.