Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 4
0
 def __unicode__(self):
     """Render the template."""
     return render_template(self.template, widget=self)
Ejemplo n.º 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)
Ejemplo n.º 6
0
 def __unicode__(self):
     """Render the template."""
     return render_template(self.template, widget=self)