Beispiel #1
0
 def _process(self):
     include_summary = request.form.get('include_summary') == '1'
     tpl = make_reminder_email(self.event, include_summary,
                               request.form.get('message'))
     html = render_template('events/reminders/preview.html',
                            subject=tpl.get_subject(),
                            body=tpl.get_body())
     return jsonify(html=html)
Beispiel #2
0
 def send(self):
     """Sends the reminder to its recipients."""
     self.is_sent = True
     recipients = self.all_recipients
     if not recipients:
         logger.info('Notification %s has no recipients; not sending anything', self)
         return
     email_tpl = make_reminder_email(self.event, self.include_summary, self.include_description, self.message)
     email = make_email(bcc_list=recipients, from_address=self.reply_to_address, template=email_tpl)
     send_email(email, self.event, 'Reminder', self.creator)
Beispiel #3
0
 def send(self):
     """Sends the reminder to its recipients."""
     self.is_sent = True
     recipients = self.all_recipients
     if not recipients:
         logger.info('Notification %s has no recipients; not sending anything', self)
         return
     email_tpl = make_reminder_email(self.event_new, self.include_summary, self.message)
     email = make_email(bcc_list=recipients, from_address=self.reply_to_address, template=email_tpl)
     send_email(email, self.event_new, 'Reminder', self.creator)
Beispiel #4
0
    def send(self):
        """Send the reminder to its recipients."""
        self.is_sent = True
        recipients = self.all_recipients
        if not recipients:
            logger.info('Notification %s has no recipients; not sending anything', self)
            return
        email_tpl = make_reminder_email(self.event, self.include_summary, self.include_description, self.message)
        attachments = []
        if self.attach_ical:
            event_ical = event_to_ical(self.event, skip_access_check=True, method='REQUEST',
                                       organizer=(core_settings.get('site_title'), config.NO_REPLY_EMAIL))
            attachments.append(MIMECalendar('event.ics', event_ical))

        for recipient in recipients:
            email = self._make_email(recipient, email_tpl, attachments)
            send_email(email, self.event, 'Reminder', self.creator, log_metadata={'reminder_id': self.id})
Beispiel #5
0
 def send(self):
     """Send the reminder to its recipients."""
     self.is_sent = True
     recipients = self.all_recipients
     if not recipients:
         logger.info(
             'Notification %s has no recipients; not sending anything',
             self)
         return
     email_tpl = make_reminder_email(self.event, self.include_summary,
                                     self.include_description, self.message)
     attachments = []
     if self.attach_ical:
         event_ical = event_to_ical(self.event)
         attachments.append(('event.ics', event_ical, 'text/calendar'))
     email = make_email(bcc_list=recipients,
                        from_address=self.reply_to_address,
                        template=email_tpl,
                        attachments=attachments)
     send_email(email, self.event, 'Reminder', self.creator)
Beispiel #6
0
 def _process(self):
     tpl = make_reminder_email(self.event, request.form.get('include_summary') == '1', request.form.get('message'))
     html = render_template('events/reminders/preview.html', subject=tpl.get_subject(), body=tpl.get_body())
     return jsonify(html=html)
Beispiel #7
0
 def _process(self):
     tpl = make_reminder_email(self.event, request.form.get("include_summary") == "1", request.form.get("message"))
     html = render_template("events/reminders/preview.html", subject=tpl.get_subject(), body=tpl.get_body())
     return jsonify(html=html)