# HG changeset patch
# Parent d09d67a750ae89b79586afbcac4a3f43777a5757
Also send attachment's description in the body of the notification mail. Applies on top of [attachment:attachment_0.13dev.2.patch].

diff -r d09d67a750ae -r 218983e06837 trac/ticket/notification.py
--- a/trac/ticket/notification.py	Thu May 19 13:10:37 2011 +0200
+++ b/trac/ticket/notification.py	Thu May 19 14:11:14 2011 +0200
@@ -137,7 +137,7 @@ class TicketNotifyEmail(NotifyEmail):
             ticket.fields = translated_fields
             reactivate(t)
 
-    def notify_attachment(self, ticket, author, filename, modtime, add):
+    def notify_attachment(self, ticket, author, filename, modtime, body):
         """Send ticket attachment notification (untranslated)"""
         t = deactivate()
         translated_fields = ticket.fields
@@ -159,9 +159,8 @@ class TicketNotifyEmail(NotifyEmail):
             ticket_values['new'] = self.newticket
             ticket_values['link'] = link
             subject = 'Re: ' + self.format_subj(summary)
-            body = '%s attachment "%s"' % (add and 'Add' or 'Delete', filename)
             author = obfuscate_email_address(author)
-            change = { 'author': author }
+            change = {'author': author}
             self.data.update({
                 'ticket_props': self.format_props(),
                 'ticket_body_hdr': self.format_hdr(),
@@ -492,4 +491,11 @@ class TicketAttachmentNotifier(Component
         tn = TicketNotifyEmail(self.env)
         filename = attachment.filename
         date = attachment.date or datetime.now(utc)
-        tn.notify_attachment(ticket, author, filename, date, add)
+        # Note: no translation yet
+        if add:
+            body = "Attachment \"%s\" added." % filename
+        else:
+            body = "Attachment \"%s\" removed." % filename
+        if attachment.description:
+            body += "\n\n" + attachment.description
+        tn.notify_attachment(ticket, author, filename, date, body)

