Пример #1
0
 def mail_from_notification(self, message):
     title = message.title.to_text()
     details = self.find_details(message.details)
     longtext = message.longtext.to_text(collect_urls=True,
                                         initial_indent=2)
     actions = self.find_actions(message.actions)
     return render_template('notifications/email.txt', title=title,
                            details=details, longtext=longtext,
                            actions=actions)
Пример #2
0
 def mail_from_notification(self, message):
     title = message.title.to_text()
     details = self.find_details(message.details)
     longtext = message.longtext.to_text(collect_urls=True,
                                         initial_indent=2)
     actions = self.find_actions(message.actions)
     return render_template('notifications/email.txt',
                            title=title,
                            details=details,
                            longtext=longtext,
                            actions=actions)
Пример #3
0
def send_notification_template(type, template_name, user=Ellipsis, **context):
    """Like `send_notification` but renders a template instead."""
    notification = render_template(template_name, **context)
    send_notification(type, notification, user)
Пример #4
0
 def __unicode__(self):
     """Render the template."""
     return render_template(self.template, widget=self)
Пример #5
0
def send_notification_template(type, template_name, user=Ellipsis, **context):
    """Like `send_notification` but renders a template instead."""
    notification = render_template(template_name, **context)
    send_notification(type, notification, user)
Пример #6
0
 def __unicode__(self):
     """Render the template."""
     return render_template(self.template, widget=self)