예제 #1
0
def new_reaction_notification(sender, instance, created, **kwargs):
    if created:
        container = ObserversContainer()
        container.notify_reaction_observers(instance)
예제 #2
0
                          author=self.reaction_author,
                          receiver=self.post_author)
                mailed_users.add(self.post_author)

        # Implement 2a: send email to Object owner, if Reaction author is not
        # the Object owner.
        for manager in set(
            [project.owner, project.task_manager, project.promoter]):

            if manager and self.reaction_author != manager:
                if manager not in mailed_users:

                    with TenantLanguage(manager.primary_language):
                        subject = _('%(author)s commented on your project') % {
                            'author': self.reaction_author.get_short_name()
                        }

                    send_mail(
                        template_name='project_wallpost_reaction_project.mail',
                        subject=subject,
                        to=manager,
                        project=project,
                        site=self.site,
                        link='/go/projects/{0}'.format(project.slug),
                        author=self.reaction_author,
                        receiver=manager)


ObserversContainer().register(ProjectWallObserver)
ObserversContainer().register(ProjectReactionObserver)
예제 #3
0
def new_wallpost_notification(sender, instance, created, **kwargs):
    container = ObserversContainer()
    container.notify_wallpost_observers(instance)
예제 #4
0
                          subject=subject,
                          to=self.post_author,
                          site=self.site,
                          task=task,
                          link='/go/tasks/{0}'.format(task.id),
                          author=self.reaction_author,
                          receiver=self.post_author)
                mailed_users.add(self.post_author)

        # Implement 2a: send email to Object owner, if Reaction author is not
        # the Object owner.
        if self.reaction_author != task_author:
            if task_author not in mailed_users:
                with TenantLanguage(task_author.primary_language):
                    subject = _('%(author)s commented on your task') % {
                        'author': self.reaction_author.get_short_name()
                    }

                send_mail(template_name='task_wallpost_reaction_task.mail',
                          subject=subject,
                          to=task_author,
                          site=self.site,
                          task=task,
                          link='/go/tasks/{0}'.format(task.id),
                          author=self.reaction_author,
                          receiver=task_author)


ObserversContainer().register(TaskWallObserver)
ObserversContainer().register(TaskReactionObserver)