def blog_comment_added(self, postname, number): action = 'post_comment_added' blog_post = BlogPost(self.env, postname, 0) bc = BlogComment(self.env, postname, number) notifier = FullBlogNotificationEmail(self.env) notifier.notify(blog_post, action, blog_post.version, bc.time, bc.comment, bc.author)
def blog_post_changed(self, postname, version): if version > 1: action = 'post_updated' else: action = 'post_created' blog_post = BlogPost(self.env, postname, version) notifier = FullBlogNotificationEmail(self.env) notifier.notify(blog_post, action, version, blog_post.version_time, blog_post.version_comment, blog_post.version_author)
def blog_post_deleted(self, postname, version, fields): if version > 0: action = 'post_deleted_version' else: action = 'post_deleted' blog_post = BlogPost(self.env, postname, version) # the post has already been deleted, so populate from fields # this is just so we can say which page was deleted blog_post.title = fields['title'] blog_post.author = fields['author'] author = fields['version_author'] time = datetime.datetime.now(utc) notifier = FullBlogNotificationEmail(self.env) notifier.notify(blog_post, action, version, time, '', author)