web/views/massmailing.py
branch3.0
changeset 431 18b4dd650ef8
parent 0 b97547f5f1fa
child 635 305da8d6aa2d
equal deleted inserted replaced
430:6fbc0ab79a2d 431:18b4dd650ef8
     9 
     9 
    10 from logilab.mtconverter import html_escape
    10 from logilab.mtconverter import html_escape
    11 
    11 
    12 from cubicweb.interfaces import IEmailable
    12 from cubicweb.interfaces import IEmailable
    13 from cubicweb.common.view import EntityView
    13 from cubicweb.common.view import EntityView
    14 from cubicweb.common.selectors import interface_selector, in_group_selector
    14 from cubicweb.common.selectors import implement_interface, match_user_group
    15 from cubicweb.web.action import EntityAction
    15 from cubicweb.web.action import EntityAction
    16 from cubicweb.web import stdmsgs
    16 from cubicweb.web import stdmsgs
    17 
    17 
    18 
    18 
    19 class SendEmailAction(EntityAction):
    19 class SendEmailAction(EntityAction):
    20     category = 'mainactions'
    20     category = 'mainactions'
    21     __selectors__ = (interface_selector, in_group_selector)
    21     __selectors__ = (implement_interface, match_user_group)
    22     accepts_interfaces = (IEmailable,) # XXX should check email is set as well
    22     accepts_interfaces = (IEmailable,) # XXX should check email is set as well
    23     require_groups = ('managers', 'users')
    23     require_groups = ('managers', 'users')
    24 
    24 
    25     id = 'sendemail'
    25     id = 'sendemail'
    26     title = _('send email')
    26     title = _('send email')
    33                               **params)
    33                               **params)
    34 
    34 
    35 
    35 
    36 class MassMailingForm(EntityView):
    36 class MassMailingForm(EntityView):
    37     id = 'massmailing'
    37     id = 'massmailing'
    38     __selectors__ = (interface_selector, in_group_selector)
    38     __selectors__ = (implement_interface, match_user_group)
    39     accepts_interfaces = (IEmailable,)
    39     accepts_interfaces = (IEmailable,)
    40     require_groups = ('managers', 'users')
    40     require_groups = ('managers', 'users')
    41     
    41     
    42 
    42 
    43     form_template = u"""
    43     form_template = u"""