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>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>My template is:<br>{<br> my $ToAddress = '<a href="mailto:dtb@dummy.org">dtb@dummy.org</a>';<br> my $FromAddress = $Ticket->CreatorObj->EmailAddress;<br> my $Subject = $RT::DisableSubjectToken;
<br> $Subject .= 'dummy' . $Ticket->Transactions->First->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>SendEmail_Local.pm looks like this:<br><br>use strict;<br>no warnings qw(redefine);
<br><br>sub SetSubjectToken {<br> my $self = shift;<br> my $tag = "[$RT::rtname #" . $self->TicketObj->id . "] ";<br> my $sub = $self->TemplateObj->MIMEObj->head->get('Subject');
<br> my $no_rt_flag = $RT::DisableSubjectToken if $RT::DisableSubjectToken;<br><br> unless ( $sub =~ /\Q$tag\E/ ) {<br> $sub =~ s/(\r\n|\n|\s)/ /gi;<br> chomp $sub;<br><br> if ( $no_rt_flag && $sub =~ /^\Q$no_rt_flag\E/ ) {
<br> $sub =~ s/(\Q$no_rt_flag\E)//;<br> $tag = '';<br> }<br> $self->TemplateObj->MIMEObj->head->replace( 'Subject', $tag . $sub );<br> }<br>}<br><br>1;<br><br>
And the email header is:<br><br>From: <a href="mailto:dmh@ngat.com">dmh@ngat.com</a>
<br>To: <a href="mailto:lco@kdna.com">lco@kdna.com</a>
<br>Reply-To: <a href="mailto:dmh@ngat.com">dmh@ngat.com</a>
<br>Subject: dummy
<br><br>Somewhere the original subject gets lost. Any ideas why?<br><br>(I am running RT 3.6.5)<br><br>Thanks,<br><br>Doro<br><br><br><br><div><span class="gmail_quote">On 01/11/2007, Gene LeDuc wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div dir="ltr" align="left"> </div>
<div></div>Hi Doro,<br><br>I needed a way to strip the ticket info from the
subject line also, but couldn't find anything within RT that would let me do
this. I ended up modifying the SetSubjectToken method of <a href="http://Sendmail.pm" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Sendmail.pm</a> so
that I could selectively turn off the feature that adds the [myrt #1234] token
to the beginning of the subject.<br><br>To disable the "add ticket info"
feature, you add a "secret code" to the beginning of the subject line in your
template. If the code is there, my mod strips it and then sends the e-mail
with the original subject line unchanged. If the code isn't there, the
subject line gets modified as usual. You set a variable
($DisableSubjectToken) in RT_SiteConfig.pm to some random sequence of characters
that are not likely to ever show up at the beginning of one of your ticket
subjects and prepend that variable to your subject line in your template when
you want to turn off ticket stamping.<br><br>It may be overkill, but it works
great for us and stays out of the way unless I need it. Here's where you
can find it:<br><br><a href="http://wiki.bestpractical.com/view/SendEmail" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://wiki.bestpractical.com/view/SendEmail</a><br><br>The
documentation might be a little muddy, so feel free to ask if you can't figure
it out.<br><br>Regards,<br>Gene<br><br>At 04:11 AM 10/31/2007, Dorothea
Muecke-Herzberg wrote:<br>
<blockquote type="cite"><font color="#0000ff" size="2">Previous
email to the list brought back to my mind an issue we have. We need to send
emails to<br>another tool from RT and this tool scans the start of the subject
line, so we need to<br>strip rtname from the subject line somehow (or at least
move it to the end).<br>Is there a way to do this?<br></font> <br><font color="#0000ff" size="2">Doro</font></blockquote>
<p><br>-- <br>Gene LeDuc, GSEC<br>Security Analyst<br>San Diego State
University </p></div>
</blockquote></div><br>