Opened 18 years ago
Last modified 7 years ago
#3517 closed enhancement
Notification plugin — at Version 16
Reported by: | Owned by: | Peter Suter | |
---|---|---|---|
Priority: | normal | Milestone: | 1.1.3 |
Component: | notification | Version: | 0.9.6 |
Severity: | major | Keywords: | |
Cc: | ufs@…, davidf@…, pacopablo@…, Jun Omae | Branch: | |
Release Notes: |
Allow plugins to extend notification system. |
||
API Changes: |
Added new API for notification distribution and extension points:
|
||
Internal Changes: |
Description
Currently trac only supports email notifications. For some environments it it would be very practical to use different kinds of notifications; for example to send a SMS when tickets of a specific type are files, or to notify CIA of new tickets.
It seems sensible to create an extension point for the notification infrastructure so one or more plugins can handle notifications.
Change History (19)
by , 18 years ago
Attachment: | trac-cia.diff added |
---|
comment:1 by , 18 years ago
I've added a patch which implements a trac-CIA connection. This implementation is quite bad since it hooks trac directly into the email notifier logic, but the xmlrpc code can easily be reused.
comment:2 by , 17 years ago
Component: | ticket system → notification |
---|---|
Milestone: | → 0.12 |
Owner: | changed from | to
Severity: | normal → major |
Yes, a more generic infrastructure for notifications will be a big topic for 0.12.
comment:3 by , 17 years ago
Cc: | added |
---|
comment:4 by , 16 years ago
I'd really appreciate if someone could manage to update this patch to work with 0.10.4 - my python skills are sadly lacking!
comment:5 by , 16 years ago
I did an improved version of that patch for 0.10 a while ago. I'll add it to this issue.
follow-up: 8 comment:6 by , 16 years ago
Cc: | added |
---|
Also wanting to add a generic jabber notification system…. again this would make sense as a plugin
comment:7 by , 16 years ago
We definitely need a few explanations about how to make it work. I've patched my trac, figured a few config items from code, but i can't make it work. Can someone please post instructions and a config sample? Thanks in advance.
comment:8 by , 16 years ago
Replying to davidf@sjsoft.com:
Also wanting to add a generic jabber notification system…. again this would make sense as a plugin
BTW, for Mac users only: I've written a growl notification plugin.
comment:9 by , 16 years ago
For reference this is the configuration we use for Plone:
[notification] always_notify_owner = true always_notify_reporter = true cia_enabled = true cia_project = Plone cia_server = http://cia.navi.cx smtp_always_cc = plone-collector@objectrealms.net smtp_enabled = true smtp_from = discard@antiloop.plone.org smtp_password = smtp_port = 25 smtp_replyto = discard@antiloop.plone.org smtp_server = localhost smtp_user =
comment:10 by , 16 years ago
Cc: | added |
---|
follow-up: 15 comment:11 by , 10 years ago
The INotificationDistributor extension point of the AdvancedNotification proposal provides a clean way for plugins to implement such alternative notification protocols.
The proposed changes can be found in log:psuter@advanced-notification-mail-distribution.
Several other new extension points and public APIs for plugins are also introduced there. These might have to be reviewed and discussed in some more detail. For example I listed some open questions in the relevant wiki pages (e.g. NotificationEvent API, INotificationFormatter and IEmailAddressResolver).
comment:12 by , 10 years ago
Milestone: | next-major-releases → 1.1.2 |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:13 by , 10 years ago
Cc: | added |
---|
comment:14 by , 10 years ago
Milestone: | 1.1.2 → 1.1.3 |
---|
comment:15 by , 9 years ago
The proposed changes can be found in log:psuter@advanced-notification-mail-distribution.
Updated in log:psuter@advanced-notification-mail-distribution.2.
These might have to be reviewed and discussed in some more detail. For example I listed some open questions in the relevant wiki pages (e.g. NotificationEvent API, INotificationFormatter and IEmailAddressResolver).
I'll probably just commit the current state. We can still fine-tune later if problems emerge.
comment:16 by , 9 years ago
Committed to trunk in [13454]. I'll follow up with changes for milestone delete and retargeting events:
-
trac/ticket/roadmap.py
diff -r c5cadf7e6beb trac/ticket/roadmap.py
a b 35 35 from trac.util.text import CRLF, exception_to_unicode, to_unicode 36 36 from trac.util.translation import _, tag_ 37 37 from trac.ticket.api import TicketSystem 38 from trac.ticket.notification import BatchTicketNotifyEmail38 from trac.ticket.notification import send_ticket_event, BatchTicketChangeEvent 39 39 from trac.ticket.model import Milestone, MilestoneCache, Ticket, \ 40 40 group_milestones 41 41 from trac.timeline.api import ITimelineEventProvider … … 775 775 new_values = {'milestone': retarget_to} 776 776 comment = comment or \ 777 777 _("Open tickets retargeted after milestone closed") 778 tn = BatchTicketNotifyEmail(self.env) 778 event = BatchTicketChangeEvent(retargeted_tickets, None, 779 req.authname, comment, 780 new_values, None) 779 781 try: 780 tn.notify(retargeted_tickets, new_values, comment, None, 781 req.authname) 782 send_ticket_event(self.env, self.config, event) 782 783 except Exception as e: 783 784 self.log.error("Failure sending notification on ticket " 784 785 "batch change: %s", … … 827 828 retarget=retarget_to)) 828 829 new_values = {'milestone': retarget_to} 829 830 comment = _("Tickets retargeted after milestone deleted") 830 tn = BatchTicketNotifyEmail(self.env) 831 event = BatchTicketChangeEvent(retargeted_tickets, None, 832 req.authname, comment, new_values, 833 None) 831 834 try: 832 tn.notify(retargeted_tickets, new_values, comment, None, 833 req.authname) 835 send_ticket_event(self.env, self.config, event) 834 836 except Exception as e: 835 837 self.log.error("Failure sending notification on ticket batch " 836 838 "change: %s", exception_to_unicode(e))
Example of submitting messages to CIA from trac