Notify with Attachments for RT3

Hi all,

I tried to port the excellent NotifyWithAttchment,

to RT3 by adding the following code as Custom action preparation code to
“On Comment Notify AdminCcs as Comment with template Admin Comment” and
“On Correspond Notify Requestors, Ccs and AdminCcs with template

my $self = shift;

$self->SUPER::Prepare() || return 0;

my $attachments = $self->TransactionObj->Attachments;

my $cnt = $attachments->Count;
$RT::Logger->debug(“$self: Adding $cnt atts.\n”);

skip the first one, it is already attached

Why do I have to skip two?


while (my $message=$attachments->Next) {
next unless ($message->Content);

my $fname = $message->Filename;
$fname =~ s/.*(\|/)//g;
$RT::Logger->debug(“$self: Adding attachment $fname.\n”);

$self->TemplateObj->MIMEObj->attach(Data => $message->Content,
Type => $message->ContentType,
Encoding => “base64”,
Description => $fname,
Disposisiton => “attachment”,
Filename => $fname);

However, it seems to only echo out attchments for correspondance, not
for comments. Can anyone see anything wrong?


It turns out that i needed

RT-Attach-Message: Yes

In the Admin Comment template for attachments to be attached to
comments. (Thanks Ruslan Zakirov!)


Mike White wrote: