Hi Doro,
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
my $Subject = $RT::DisableSubjectToken;
with
my $Subject = '"";
You can also use
$RT::Logger->debug("Subject is =$Subject=");
to log what is happening.
This will help focus the problem area.
Gene
At 05:28 PM 10/31/2007, Dorothea Muecke-Herzberg wrote:
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.
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.
My template is:
{
my $ToAddress = '<mailto:[EMAIL PROTECTED]>[EMAIL PROTECTED]';
my $FromAddress = $Ticket->CreatorObj->EmailAddress;
my $Subject = $RT::DisableSubjectToken;
$Subject .= 'dummy' . $Ticket->Transactions->First->Subject;
my $Content = $Ticket->Transactions->First->Content();
$OUT = "From: $FromAddress\n";
$OUT .= "To: $ToAddress\n";
$OUT .= "Reply-To: $FromAddress\n";
$OUT .= "Subject: $Subject\n\n";
$OUT .= "$Content\n";
}
SendEmail_Local.pm looks like this:
use strict;
no warnings qw(redefine);
sub SetSubjectToken {
my $self = shift;
my $tag = "[$RT::rtname #" . $self->TicketObj->id . "] ";
my $sub = $self->TemplateObj->MIMEObj->head->get('Subject');
my $no_rt_flag = $RT::DisableSubjectToken if $RT::DisableSubjectToken;
unless ( $sub =~ /\Q$tag\E/ ) {
$sub =~ s/(\r\n|\n|\s)/ /gi;
chomp $sub;
if ( $no_rt_flag && $sub =~ /^\Q$no_rt_flag\E/ ) {
$sub =~ s/(\Q$no_rt_flag\E)//;
$tag = '';
}
$self->TemplateObj->MIMEObj->head->replace( 'Subject', $tag . $sub );
}
}
1;
And the email header is:
From: <mailto:[EMAIL PROTECTED]>[EMAIL PROTECTED]
To: <mailto:[EMAIL PROTECTED]>[EMAIL PROTECTED]
Reply-To: <mailto:[EMAIL PROTECTED]>[EMAIL PROTECTED]
Subject: dummy
Somewhere the original subject gets lost. Any ideas why?
(I am running RT 3.6.5)
Thanks,
Doro
--
Gene LeDuc, GSEC
Security Analyst
San Diego State University
_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:
If you sign up for a new RT support contract before December 31, we'll take
up to 20 percent off the price. This sale won't last long, so get in touch
today.
Email us at [EMAIL PROTECTED] or call us at +1 617 812 0745.
Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]
Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com