[rt-users] adding custom filed value to email

Gene LeDuc gleduc at mail.sdsu.edu
Thu Mar 27 12:04:52 EDT 2008


Hi Gary,

Here's how I do it.  I like using subroutines so I can reuse the code, so 
this is a subroutine that I'd have at the end of my template.

   ### Returns custom field value
   ### get_custom($field_name)
   sub get_custom {
     my $target_name = $_[0];
     my $val = $Ticket->FirstCustomFieldValue($target_name);
     return $val if defined $val;
     return undef;
   }

To get your value using this subroutine you have something like this:

   my $uLocations = get_custom('Locations');

And then you just use $uLocations in your template wherever you want it 
displayed.

Regards,
Gene

At 06:25 AM 3/27/2008, Gary & Gina Koteras wrote:
>Hello,
>
>    We are running RT 3.4.5. I created one custom field and would like to 
> add the value that is chosen to the email that is generated. Any help 
> would be greatly appreciated. The custom field name is "Locations"
>
>Thanks in advance,
>gary


-- 
Gene LeDuc, GSEC
Security Analyst
San Diego State University 




More information about the rt-users mailing list