Exemple #1
0
 def email_all(self, action):
     data, errors = self.extractData()
     if errors:
         self.status = '\n'.join([error.error.__str__() for error in errors])
         return 
     data = utils.save_attendees(self.context, data)
     utils.email_recipients(self.context, data)
     addStatusMessage(self.request, 
                     "Attendees have been saved and notified",
                     type='info')
     self.request.response.redirect(self.context.REQUEST.get('URL'))
Exemple #2
0
    def email_new(self, action):
        data, errors = self.extractData()
        if errors:
            self.status = '\n'.join([error.error.__str__() for error in errors])
            return 

        context = aq_inner(self.context)
        new_attendees = utils.get_new_attendees(context, data)
        utils.save_attendees(context, data)
        utils.email_recipients(context, new_attendees)
        if new_attendees['internal_attendees'] or \
                new_attendees['external_attendees']:
            addStatusMessage(self.request, 
                            "The new attendees have been added and notified.",
                            type='info')
        self.request.response.redirect(self.context.REQUEST.get('URL'))