templates_buildsdir = $(templatesdir)/builds
+dist_templates_builds_messages_DATA = \
+ src/templates/builds/messages/comment.txt
+
+templates_builds_messagesdir = $(templates_buildsdir)/messages
+
dist_templates_builds_modules_DATA = \
src/templates/builds/modules/list.html
templates_messagesdir = $(templatesdir)/messages
-dist_templates_messages_builds_DATA = \
- src/templates/messages/builds/new-comment.markdown
-
-templates_messages_buildsdir = $(templates_messagesdir)/builds
-
dist_templates_messages_users_DATA = \
src/templates/messages/users/email-activation.markdown
"""
pass # XXX TODO
- @property
- def message_recipients(self):
- ret = []
-
- for watcher in self.watchers:
- ret.append("%s <%s>" % (watcher.realname, watcher.email))
-
- return ret
-
@lazy_property
def repo(self):
res = self.db.get("SELECT repo_id FROM repositories_builds \
return self.data.score
def notify(self):
- self.backend.messages.send_template_to_many(self.build.message_recipients, "builds/new-comment",
- sender=self.user.envelope_from, build=self.build, user=self.user, text=self.text)
+ for watcher in self.build.watchers:
+ watcher.send_email("builds/messages/comment.txt",
+ build=self.build, comment=self)
--- /dev/null
+Subject: {{ _("%(user)s commented on %(build)s") % { "user" : comment.user, "build" : build }}
+
+{% for line in comment.text.splitlines() %} {{ line }}{% end %}
+++ /dev/null
-Subject: {{ _("%(user)s commented on %(build)s") % { "user" : user.realname, "build" : build }}
-
-{% for line in text.splitlines() %} {{ line }}{% end %}