https://rt-wiki.bestpractical.com/index.php?title=MoveRTName&feed=atom&action=history
MoveRTName - Revision history
2024-03-29T08:13:58Z
Revision history for this page on the wiki
MediaWiki 1.37.2
https://rt-wiki.bestpractical.com/index.php?title=MoveRTName&diff=2258&oldid=prev
Admin: 2 revisions imported
2016-04-06T20:15:44Z
<p>2 revisions imported</p>
<p><b>New page</b></p><div>To move the [rt.foo.com #1234] to the end of message subject lines, insert this code into your [[RT SiteConfig|RT_SiteConfig]].pm:<br />
<br />
{<br />
use RT::Action::SendEmail;<br />
no warnings qw'redefine';<br />
<br />
sub RT::Action::SendEmail::SetSubjectToken {<br />
my $self = shift;<br />
my $sub = $self-&gt;TemplateObj-&gt;MIMEObj-&gt;head-&gt;get('Subject');<br />
my $id = $self-&gt;TicketObj-&gt;id;<br />
<br />
my $token_re = $RT::EmailSubjectTagRegex;<br />
$token_re = qr/\Q$RT::rtname\E/o unless $token_re;<br />
$sub =~ s/\[$token_re\s+#$id\]//;<br />
<br />
$sub =~ s/(\r\n|\n|\s)/ /gi;<br />
chomp $sub;<br />
$sub = substr($sub,0,80);<br />
$sub =~ s/\s*$//g;<br />
$self-&gt;TemplateObj-&gt;MIMEObj-&gt;head-&gt;replace( Subject =&gt; "$sub [$RT::rtname #$id]",<br />
);<br />
}<br />
}<br />
<br />
-- JesseVincent</div>
Admin