web/views/massmailing.py
branchtls-sprint
changeset 640 8e64f12be69c
parent 635 305da8d6aa2d
child 742 99115e029dca
equal deleted inserted replaced
635:305da8d6aa2d 640:8e64f12be69c
     1 """Mass mailing form views
     1 """Mass mailing form views
     2 
     2 
     3 :organization: Logilab
     3 :organization: Logilab
     4 :copyright: 2007-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     4 :copyright: 2007-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
     5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
     6 """
     6 """
     7 
     7 
     8 import operator
     8 import operator
     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.selectors import implements, match_user_groups
    13 from cubicweb.selectors import implements, match_user_groups
    14 from cubicweb.common.view import EntityView
    14 from cubicweb.common.view import EntityView
    15 from cubicweb.web.action import EntityAction
    15 from cubicweb.web.action import Action
    16 from cubicweb.web import stdmsgs
    16 from cubicweb.web import stdmsgs
    17 
    17 
    18 
    18 
    19 class SendEmailAction(EntityAction):
    19 class SendEmailAction(Action):
    20     category = 'mainactions'
    20     category = 'mainactions'
    21     # XXX should check email is set as well
    21     # XXX should check email is set as well
    22     __selectors__ = (implements(IEmailable), match_user_groups('managers', 'users'))
    22     __selectors__ = (implements(IEmailable), match_user_groups('managers', 'users'))
    23 
    23 
    24     id = 'sendemail'
    24     id = 'sendemail'