[rt-users] Template Variables - Not In FromAddress?!?

Kevin Falcone falcone at bestpractical.com
Sat Aug 30 11:37:05 EDT 2008


On Aug 28, 2008, at 1:13 PM, Paul Broadwith wrote:

> Hi,
>
> I’m using the template from the second message in this thread http://www.gossamer-threads.com/lists/rt/users/74122 
> . While the problem I’m having is not this template in general  
> (otherwise I’d contact the author), I have a question about the  
> variables in FromAddress.
>
> The original code is this:
>
> my $FromAddress = 'RT Requests <rt[at]myorg.org>';
> my $ContactAddress = 'real.person[at]myorg.org';
>
> Now I’ve modified it to:
>
> my $FromAddress = 'RT Requests <$RT::CorrespondAddress>';

Perl doesn't interpolate variables in single quotes, only in double  
quotes.  Single quotes indicates
'this is a static string'.

my $FromAddress = "RT Requests <$RT::CorrespondAddress>";

Please note, if you're setting Correspond Addresses on any of your  
Queues, this may not be the
correct logic

-kevin

> my $ContactAddress = $RT::CorrespondAddress;
>
> The $ContactAddress works fine and comes out to the correct address  
> (as this is used in the message body later on), however the  
> FromAddress is show as $RT::CorrespondAddress at MYHOSTNAME (where  
> MYHOSTNAME is the hostname of the server it’s running on). I can’t  
> understand why this is.
>
> I’ve tried moving the < and > around the address so that it has  
> spaces there in case that caused it. I’ve even modified the code so  
> that it is:
>
> my $ContactAddress = $RT::CorrespondAddress;
> my $FromAddress = 'RT Requests < $ContactAddress >';
>
> And the problem is still there. Can anybody help?
>
> One other amendment I was wanting to make was to change the  
> FromAddress so that it reads:
>
> my $FromAddress = ‘$Ticket->QueueObj->Description < $ContactAddress  
> >';
>
> Which is what the AutoReply template uses when responding. Again  
> this doesn’t work and I removed it from the code so that it doesn’t  
> complicate things, however anybody help with this too?
>
> Many thanks in advance.
>
> Kind regards,
>
> Paul Broadwith
> {Blue Ivy Ltd - ICT For Small Businesses}
>
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Community help: http://wiki.bestpractical.com
> Commercial support: sales at bestpractical.com
>
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> Buy a copy at http://rtbook.bestpractical.com




More information about the rt-users mailing list