Edgewall Software

Changes between Version 15 and Version 16 of CookBook/Notification/Subscriptions


Ignore:
Timestamp:
Feb 20, 2019, 7:39:35 PM (5 years ago)
Author:
khym@…
Comment:

Allow ReplyToTicketSubscriber to work as a default notification (gmessage:trac-users:DclunltOMFM/zB6g-rF7AAAJ)

Legend:

Unmodified
Added
Removed
Modified
  • CookBook/Notification/Subscriptions

    v15 v16  
    267267
    268268from trac.core import Component, implements
    269 from trac.notification.api import INotificationSubscriber
     269from trac.notification.api import (INotificationSubscriber, NotificationSystem)
    270270from trac.notification.mail import RecipientMatcher
    271271from trac.notification.model import Subscription
     
    294294            return
    295295        sid, auth, addr = recipient
     296
     297        # Default subscription
     298        for s in self.default_subscriptions():
     299            yield s[0], s[1], sid, auth, addr, s[2], s[3], s[4]
    296300
    297301        if sid:
     
    305309
    306310    def default_subscriptions(self):
    307         return []
     311        klass = self.__class__.__name__
     312        return NotificationSystem(self.env).default_subscriptions(klass)
    308313
    309314    def requires_authentication(self):