I would like to send a notification to an external e-mail address upon the creation of a new ticket on a specific queue, and I would like to add to this notification any possible attachment that the customer may have included to the new ticket.
For this reason I defined a Notification event that is triggered on the "ArticleCreate" event for this specific queue (filtered in the "Ticket Filter" section) and with the Article Filter set as:
Article Type: webrequest
Article sender type: customer
Include attachments to notification: yes
All works as expected, but for a little thing: along with any "real" attachment, also the whole ticket body is sent out as an attachment itself to the notification, wrapped into an html text file.
Question: Is there a way to strip this part and send out the notification only with the real (if any) attachment?
Looking at the code I see that in /Kernel/System/Ticket/Event/NotificationEvent.pm there is this part:
Code: Select all
# add attachments to notification
if ( $Notification{Data}->{ArticleAttachmentInclude}->[0] ) {
my %Index = $TicketObject->ArticleAttachmentIndex(
ArticleID => $Param{Data}->{ArticleID},
UserID => $Param{UserID},
StripPlainBodyAsAttachment => 3,
);
if (%Index) {
FILE_ID:
for my $FileID ( sort keys %Index ) {
my %Attachment = $TicketObject->ArticleAttachment(
ArticleID => $Param{Data}->{ArticleID},
FileID => $FileID,
UserID => $Param{UserID},
);
next FILE_ID if !%Attachment;
push @Attachments, \%Attachment;
}
}
}
}
Do you know is there anything that I could do to actually strip this "fake" attachment from the notification?
Thank you in advance,
Giulio