RT-Users Digest, Vol 5, Issue 76

Why cant I do this to set the From address in a template?? Basically I
have a custom field (7) that will have a value of PRTC or VZD and I need
to set the from address dependent on which one it is?

####### Template Start #######

if($self->TicketObj->FirstCustomFieldValue(7) =~ /PRTC/) {From: Security security@prtcmail.prtc.net

} elsif($self->TicketObj->FirstCustomFieldValue(7) =~ /VZD/) {
From: Security <sadmin@verizon.net.do>

} else {
From: “Abuse <abuse@gsoc.verizon.com>”

}

Subject: AutoReply: {$Ticket->Subject}

Greetings,

Blah, blah, blah …

####### Template End ########

ERROR START

[Fri Aug 27 19:23:18 2004] [error]: error: couldn’t parse head; error
near:
if($self->TicketObj->FirstCustomFieldValue(7) =~ /PRTC/) Security
<security.prtc.net> elsif($self->TicketObj->FirstCustomFieldValue(7) =~
/VZD/) Security sadmin@verizon.net.do else Abuse
abuse@gsoc.verizon.com

(/usr/local/rt3/lib/RT/Template_Overlay.pm:341)
[Fri Aug 27 19:23:18 2004] [info]: RT::Scrip=HASH(0x9c85fac): Couldn’t
prepare Notify Requestors (/usr/local/rt3/lib/RT/Scrip_Overlay.pm:346)
[Fri Aug 27 19:23:18 2004] [info]: Ticket 10356 created in queue 'Test’
by v683653 (/usr/local/rt3/lib/RT/Ticket_Overlay.pm:640)

####### ERROR END ########

Chris Hood
Investigator Verizon Global Security Operations Center
Email: christopher.l.hood@verizon.com
Desk: 972.399.5900

Verizon Proprietary

NOTICE - This message and any attached files may contain information
that is confidential and/or subject of legal privilege intended only for
the use by the intended recipient. If you are not the intended
recipient or the person responsible for delivering the message to the
intended recipient, be advised that you have received this message in
error and that any dissemination, copying or use of this message or
attachment is strictly forbidden, as is the disclosure of the
information therein. If you have received this message in error please
notify the sender immediately and delete the message.