Putting CF values in email templates?

Hi all,
I’m trying to get CF values to conditionally appear in tickets, but when I
do, the template breaks and no emails get sent to anyone. I’ve seen a few
ways of doing this in the Wiki, each a bit different and many for different
RT versions. Here’s my attempt. What did I do wrong?

{
if(my $orderNumber = $Ticket->CustomFieldValues[“Order Number”]) {
"

Testing printing the order number: " . $orderNumber . “


}
}

Thank you for any information.

Alex Hall
Automatic Distributors, IT department
ahall@autodist.com

Hi all,

Hi Alex,

I’m trying to get CF values to conditionally appear in tickets, but when I do, the template breaks and no emails get sent to anyone. I’ve seen a few ways of doing this in the Wiki, each a bit different and many for different RT versions. Here’s my attempt. What did I do wrong?

{
if(my $orderNumber = $Ticket->CustomFieldValues[“Order Number”]) {

Your syntax is a little off. Instead of:

$Ticket->CustomFieldValues[“Order Number”]

I think you want:

$Ticket->FirstCustomFieldValue(“Order Number”)

"

Testing printing the order number: " . $orderNumber . “


}
}

Thank you for any information.

Best,
Shawn