line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Siesta::Plugin::SubjectTag; |
2
|
4
|
|
|
4
|
|
11261
|
use strict; |
|
4
|
|
|
|
|
13
|
|
|
4
|
|
|
|
|
140
|
|
3
|
4
|
|
|
4
|
|
23
|
use Siesta::Plugin; |
|
4
|
|
|
|
|
53
|
|
|
4
|
|
|
|
|
39
|
|
4
|
4
|
|
|
4
|
|
112
|
use base 'Siesta::Plugin'; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
1034
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub description { |
8
|
1
|
|
|
1
|
0
|
396
|
'allows you to add something to the start of the subject line of each outgoing mail'; |
9
|
|
|
|
|
|
|
} |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub process { |
12
|
9
|
|
|
9
|
1
|
3546
|
my $self = shift; |
13
|
9
|
|
|
|
|
20
|
my $mail = shift; |
14
|
|
|
|
|
|
|
|
15
|
9
|
|
|
|
|
50
|
my $munge = $self->pref('subjecttag'); |
16
|
|
|
|
|
|
|
|
17
|
9
|
100
|
|
|
|
11990
|
return unless $munge; |
18
|
|
|
|
|
|
|
|
19
|
8
|
|
100
|
|
|
510
|
my $subject = $mail->subject || 'no subject'; |
20
|
8
|
|
|
|
|
249
|
my $list_name = $self->list->name; |
21
|
8
|
100
|
|
|
|
3568
|
$mail->subject("$munge $subject") |
22
|
|
|
|
|
|
|
unless $subject =~ /\Q$munge/; |
23
|
8
|
|
|
|
|
117
|
return; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub options { |
27
|
|
|
|
|
|
|
+{ |
28
|
11
|
|
|
11
|
1
|
142
|
'subjecttag' |
29
|
|
|
|
|
|
|
=> { |
30
|
|
|
|
|
|
|
'description' => |
31
|
|
|
|
|
|
|
'Add something to the start of the subject line of each out going mail.', |
32
|
|
|
|
|
|
|
'type' => 'string', |
33
|
|
|
|
|
|
|
'default' => '', |
34
|
|
|
|
|
|
|
'widget' => 'textbox', |
35
|
|
|
|
|
|
|
}, |
36
|
|
|
|
|
|
|
}; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
__END__ |