[rt-users] Seeking notification method advice

Tim Wilson twilson at buffalo.k12.mn.us
Wed Aug 22 23:45:39 EDT 2007


>>> On Wed, Aug 22, 2007 at  4:40 PM, in message
<6.2.1.2.2.20070822141126.025eacc8 at mail.sdsu.edu>, Gene  LeDuc
<gleduc at mail.sdsu.edu> wrote: 

> In your template you get the value of the field with:
>    my $bldg = $Ticket- >FirstCustomFieldValue('Building');

> Then you do the e- mail:
>    $OUT = "From: $from_address
> To: $addresslist
> Subject: $subject
> 
> Boilerpalte text goes here.
> ";

Gene,

Is there something magic about $from_address and $subject or do I need to create those variables? I'm assuming that I can't use the built-in RT templates for those since I'm adding all this perl to the template.

My template now looks like this:

my $bldg = $Ticket->FirstCustomFieldValue('Building');
my $group = RT::Group->new( $RT::SystemUser );
$group->LoadUserDefinedGroup("SupportTeam-$group");
my $addresslist = $group->MemberEmailAddressesAsString;

$OUT = "From: $from_address
To: $addresslist
Subject: $subject

This is a test message.
";

This isn't working, and I get the following error in the RT log:

Aug 22 22:37:43 support RT: error:    couldn't parse head; error near: my $bldg 
= $Ticket->FirstCustomFieldValue('Building'); my $group = RT::Group->new( $RT::S
ystemUser ); $group->LoadUserDefinedGroup("SupportTeam-$group"); my $addresslist
 = $group->MemberEmailAddressesAsString; (/usr/local/rt3/lib/RT/Template_Overlay
.pm:336) 

So obviously the message isn't being generated correctly. I've been scouring the wiki looking for other template examples that use this sort of method, but I'm not having much luck making sense of them. Any help would be greatly appreciated.

-Tim



-- 
Tim Wilson, Director of Technology
Buffalo-Hanover-Montrose Schools
214 1st Ave NE   Buffalo, MN  55313
ph: 763.682.8740  fax: 763.682.8743  http://www.buffalo.k12.mn.us







More information about the rt-users mailing list