On Wed, Dec 01, 2010 at 08:29:03AM -0800, Gene LeDuc wrote:
> Hi Jo,
> 
> On 11/30/2010 9:31 PM, Joanne Keown wrote:
> >Hi,
> >
> >I have been trying out numerous suggestions on how to code to include values 
> >from Custom Fields into an Auto-reply email.  The Custom Field is "First 
> >Name" and I want the first name entered on the ticket, to appear after the 
> >word "Hello" on the Auto-reply email.   The below is my latest attempt 
> >(based on user feedback on other threads) however, this doesn't work either 
> >as the email just doesn't send (NB; if I take the line of code out 
> >altogether then the email does send).
> >
> >Hello {my $First Name = $Ticket->FirstCustomFieldValue('First Name')}
> >
> >I'm not a programmer, so apologies if this problem sounds a bit 101, however 
> >I could really use some pointers.
> >
> >Kind regards
> >
> >Jo
> 
> If the line you included above is actually from your template, then
> the problem is the "my $First Name =" part.  Perl will see "$First"
> as a variable name and won't know what to do with "Name".  Try
> replacing "my $First Name =" with "my $First_Name =".  The
> underscore makes "Name" part of "$First".  I'm not sure whether
> spaces are allowed in custom field names.

Spaces in custom fields are perfectly valid.

Jo didn't seem to want to assign to a variable at all, so
Hello { $Ticket->FirstCustomFieldValue('First Name') } 
is likely to be closer to what she wants, since it will print
the content of the CF.

-kevin

Attachment: pgpSgEccfGvZp.pgp
Description: PGP signature

Reply via email to