Ejemplo n.º 1
0
    def _mails(self, users_and_watches):
        c = {'post': self.reply.content, 'author': self.reply.author.username,
             'host': Site.objects.get_current().domain,
             'thread_title': self.instance.title,
             'post_url': self.reply.get_absolute_url()}

        return emails_with_users_and_watches(
            _(u'Reply to: %s') % self.reply.thread.title,
            'forums/email/new_post.ltxt',
            c,
            users_and_watches)
Ejemplo n.º 2
0
 def _mails(self, users_and_watches):
     c = {'post': self.post.content, 'author': self.post.author.username,
          'host': Site.objects.get_current().domain,
          'thread_title': self.post.thread.title,
          'post_url': self.post.thread.get_absolute_url()}
     thread = self.post.thread
     return emails_with_users_and_watches(
         _(u'{forum} - {thread}').format(forum=thread.forum.name,
                                         thread=thread.title),
         'forums/email/new_thread.ltxt',
         c,
         users_and_watches)
Ejemplo n.º 3
0
 def _mails(self, users_and_watches):
     c = {
         'post': self.post.content,
         'author': self.post.author.username,
         'host': Site.objects.get_current().domain,
         'thread_title': self.post.thread.title,
         'post_url': self.post.thread.get_absolute_url()
     }
     thread = self.post.thread
     return emails_with_users_and_watches(
         _(u'{forum} - {thread}').format(forum=thread.forum.name,
                                         thread=thread.title),
         'forums/email/new_thread.ltxt', c, users_and_watches)
Ejemplo n.º 4
0
    def _mails(self, users_and_watches):
        subject = _(u'New thread in %s forum: %s') % (
            self.post.thread.forum.name, self.post.thread.title)
        c = {'post': self.post.content, 'author': self.post.author.username,
             'host': Site.objects.get_current().domain,
             'thread_title': self.post.thread.title,
             'post_url': self.post.thread.get_absolute_url()}

        return emails_with_users_and_watches(
            subject,
            'forums/email/new_thread.ltxt',
            c,
            users_and_watches)
Ejemplo n.º 5
0
def new_post_mails(reply, users_and_watches):
    """Return an interable of EmailMessages to send when a new post is
    created."""
    c = {'post': reply.content, 'author': reply.creator.username,
         'host': Site.objects.get_current().domain,
         'thread_title': reply.thread.title,
         'post_url': reply.get_absolute_url()}

    return emails_with_users_and_watches(
        _(u'Reply to: %s') % reply.thread.title,
        'kbforums/email/new_post.ltxt',
        c,
        users_and_watches)
Ejemplo n.º 6
0
def new_thread_mails(post, users_and_watches):
    """Return an interable of EmailMessages to send when a new thread is
    created."""
    subject = _(u'New thread in %s: %s') % (
        post.thread.document.title, post.thread.title)
    c = {'post': post.content, 'author': post.creator.username,
         'host': Site.objects.get_current().domain,
         'thread_title': post.thread.title,
         'post_url': post.thread.get_absolute_url()}

    return emails_with_users_and_watches(
        subject,
        'kbforums/email/new_thread.ltxt',
        c,
        users_and_watches)