[rt-users] Custom Template

Rey Paderna rpaderna at valueclick.com
Wed Oct 5 18:45:25 EDT 2005


Hello List,

I'm new to RT and am currently stuck.  I'm creating a custom AutoReply 
template that needs to access a mysql db on another machine.  I read that RT 
uses Text::Template so I am allowed to embed perl code in it.  Since I'm a 
newbiem I didn't want to delve with scrips yet.  Here is my template:

----START----
Subject: AutoReply: {$Ticket->Subject}


Hello,

Thank you for ....blah..blah..

{
use DBI;
$dbh=DBI->connect("DBI:mysql:db_name:1.2.3.4","user","pass",RaiseError => 1});
$sth1 = $dbh->prepare (qq{Select id from transac where email =
      "($Transaction->CreatorObj->EmailAddress)"});
$sth1->execute();
$userid = $sth1->fetchrow_array ();
"$userid";
}
 

---END---

When I send an email, it responds back with the correct SUbject and all but 
the body is blank.  I've been trying to solve this since this morning to no 
avail. If anyone can point me the correct resource, I would really appreciate 
it.  Thanks.

Rey





More information about the rt-users mailing list