<html>
<body>
I'm not sure whether it makes a difference, but "Subject" is a
function, just like "Content". Try using
"Subject()" instead of "Subject".<br><br>
At 09:38 AM 11/1/2007, Dorothea Muecke-Herzberg wrote:<br>
<blockquote type=cite class=cite cite="">I simplified the template
to:<br>
{<br>
my $ToAddress =
'<a href="mailto:mycorp@dna.com">mycorp@dna.com</a>';<br>
my $FromAddress = $Ticket->CreatorObj->EmailAddress;<br>
my $Subject .= $Ticket->Transactions->First->Subject;
<br>
$RT::Logger->debug("Subject is =$Subject=");<br>
my $Content =
$Ticket->Transactions->First->Content();<br>
$OUT = "From: $FromAddress\n";<br>
$OUT .= "To: $ToAddress\n"; <br>
$OUT .= "Reply-To: $FromAddress\n";<br>
$OUT .= "Subject: $Subject\n\n";<br>
$OUT .= "$Content\n";<br>
}<br><br>
The log says:<br><br>
[Thu Nov 1 16:01:40 2007] [debug]: Subject is == (template:5)
<br><br>
So, yes, the original subject is not coming through. !?<br><br>
Doro<br><br>
<br><br>
<dl><br>
<hr>
<dd><font face="Tahoma" size=2>From:</b> Gene LeDuc
[<a href="mailto:gleduc@mail.sdsu.edu" eudora="autourl">
mailto:gleduc@mail.sdsu.edu</a>] <br>
<dd>Sent:</b> 01 November 2007 15:45<br>
<dd>To:</b> Dorothea Muecke-Herzberg<br>
<dd>Cc:</b>
<a href="mailto:rt-users@lists.bestpractical.com">
rt-users@lists.bestpractical.com</a><br>
<dd>Subject:</b> Re: FW: [rt-users] Possible to strip rtname from subject
in specific cases?<br>
</font><br>
<dd>Hi Doro,<br><br>
<dd>It sounds like the template isn't getting the original subject line
from $Ticket->Transactions->First->Subject. Try it without
stripping the token and see what happens. Replace <br>
<blockquote type=cite class=cite cite="">
<dd> my $Subject = $RT::DisableSubjectToken; </blockquote><br>
<dd>with<br>
<dd> my $Subject = '"";<br><br>
<dd>You can also use<br>
<dd> $RT::Logger->debug("Subject is
=$Subject=");<br><br>
<dd>to log what is happening.<br><br>
<dd>This will help focus the problem area.<br><br>
<dd>Gene<br><br>
<br>
<dd>At 05:28 PM 10/31/2007, Dorothea Muecke-Herzberg wrote:<br>
<blockquote type=cite class=cite cite="">
<dd>Thank you all very much for your pointers. I've decided to implement
the SendEmail overlay from Gene, because it seems to give me exactly what
I need.<br><br>
<dd>Gene, I've got it almost working, my only problem is that the
original subject line gets stripped as well, only the prefix part of the
subject from my template gets through. <br><br>
<br>
<dd>My template is:<br>
<dd>{<br>
<dd> my $ToAddress =
'<a href="mailto:dtb@dummy.org">dtb@dummy.org</a>';<br>
<dd> my $FromAddress =
$Ticket->CreatorObj->EmailAddress;<br>
<dd> my $Subject = $RT::DisableSubjectToken; <br>
<dd> $Subject .= 'dummy' .
$Ticket->Transactions->First->Subject;<br>
<dd> my $Content =
$Ticket->Transactions->First->Content();<br>
<dd> $OUT = "From: $FromAddress\n";<br>
<dd> $OUT .= "To: $ToAddress\n"; <br>
<dd> $OUT .= "Reply-To: $FromAddress\n";<br>
<dd> $OUT .= "Subject: $Subject\n\n";<br>
<dd> $OUT .= "$Content\n";<br>
<dd>}<br><br>
<dd>SendEmail_Local.pm looks like this:<br><br>
<dd>use strict;<br>
<dd>no warnings qw(redefine); <br><br>
<dd>sub SetSubjectToken {<br>
<dd> my $self = shift;<br>
<dd> my $tag = "[$RT::rtname #" .
$self->TicketObj->id . "] ";<br>
<dd> my $sub =
$self->TemplateObj->MIMEObj->head->get('Subject'); <br>
<dd> my $no_rt_flag = $RT::DisableSubjectToken if
$RT::DisableSubjectToken;<br><br>
<dd> unless ( $sub =~ /\Q$tag\E/ ) {<br>
<dd> $sub =~ s/(\r\n|\n|\s)/
/gi;<br>
<dd> chomp $sub;<br><br>
<dd> if ( $no_rt_flag
&& $sub =~ /^\Q$no_rt_flag\E/ ) { <br>
<dd> $sub =~
s/(\Q$no_rt_flag\E)//;<br>
<dd> $tag =
'';<br>
<dd> }<br>
<dd>
$self->TemplateObj->MIMEObj->head->replace( 'Subject', $tag .
$sub );<br>
<dd> }<br>
<dd>}<br><br>
<dd>1;<br><br>
<dd>And the email header is:<br><br>
<dd>From: <a href="mailto:dmh@ngat.com">dmh@ngat.com</a> <br>
<dd>To: <a href="mailto:lco@kdna.com">lco@kdna.com</a> <br>
<dd>Reply-To: <a href="mailto:dmh@ngat.com">dmh@ngat.com</a> <br>
<dd>Subject: dummy <br><br>
<dd>Somewhere the original subject gets lost. Any ideas why?<br><br>
<dd>(I am running RT 3.6.5)<br><br>
<dd>Thanks,<br><br>
<dd>Doro</blockquote><br><br>
<dd>-- <br>
<dd>Gene LeDuc, GSEC<br>
<dd>Security Analyst<br>
<dd>San Diego State University <br><br>
</dl></blockquote>
<x-sigsep><p></x-sigsep>
<br>
-- <br>
Gene LeDuc, GSEC<br>
Security Analyst<br>
San Diego State University</body>
</html>