sobjects/notification.py
changeset 6822 47f4950ff815
parent 6807 7330d1fa02dd
child 7879 9aae456abab5
equal deleted inserted replaced
6783:5bbf827b6caf 6822:47f4950ff815
    25 from logilab.common.textutils import normalize_text
    25 from logilab.common.textutils import normalize_text
    26 from logilab.common.deprecation import class_renamed, class_moved, deprecated
    26 from logilab.common.deprecation import class_renamed, class_moved, deprecated
    27 
    27 
    28 from cubicweb.selectors import yes
    28 from cubicweb.selectors import yes
    29 from cubicweb.view import Component
    29 from cubicweb.view import Component
    30 from cubicweb.mail import NotificationView, SkipEmail
    30 from cubicweb.mail import NotificationView as BaseNotificationView, SkipEmail
    31 from cubicweb.server.hook import SendMailOp
    31 from cubicweb.server.hook import SendMailOp
    32 
    32 
    33 
    33 
    34 class RecipientsFinder(Component):
    34 class RecipientsFinder(Component):
    35     """this component is responsible to find recipients of a notification
    35     """this component is responsible to find recipients of a notification
    57         return dests
    57         return dests
    58 
    58 
    59 
    59 
    60 # abstract or deactivated notification views and mixin ########################
    60 # abstract or deactivated notification views and mixin ########################
    61 
    61 
    62 class NotificationView(NotificationView):
    62 class NotificationView(BaseNotificationView):
    63     """overriden to delay actual sending of mails to a commit operation by
    63     """overriden to delay actual sending of mails to a commit operation by
    64     default
    64     default
    65     """
    65     """
    66     def send_on_commit(self, recipients, msg):
    66     def send_on_commit(self, recipients, msg):
    67         SendMailOp(self._cw, recipients=recipients, msg=msg)
    67         SendMailOp(self._cw, recipients=recipients, msg=msg)