1. Joongi Kim
  2. trac-changeset-notifier

Source

trac-changeset-notifier / tracext / changesetnotifier / api.py

Diff from to

File tracext/changesetnotifier/api.py

     def __init__(self, env):
         NotifyEmail.__init__(self, env)
 
-    def notify(self, resid, subject, msg, old_rev, new_rev, diff):
-        self.data.update({
-            'diff_body': diff,
-            'commit_message': msg,
-            'old_rev': old_rev,
-            'new_rev': new_rev,
-        })
-        NotifyEmail.notify(self, resid, subject)
+    def notify(self, resid, template_vars):
+        self.data.update(template_vars)
+        NotifyEmail.notify(self, resid, template_vars['subject'])
 
     def get_recipients(self, resid):
         return (self.config.get('changeset', 'notification_recipients'), '')
                                        (repos.display_rev(changeset.rev), reponame))
         new_rev = repos.display_rev(changeset.rev)
         old_rev = repos.display_rev(repos.previous_rev(changeset.rev))
-        cn.notify(changeset.rev, subject, changeset.message, old_rev, new_rev, diff)
+        template_vars = {
+            'subject': subject,
+            'diff_body': diff,
+            'author': changeset.author,
+            'date': changeset.date,
+            'commit_message': changeset.message,
+            'old_rev': old_rev,
+            'new_rev': new_rev,
+        }
+        cn.notify(changeset.rev, template_vars)
 
     def changeset_modified(self, repos, changeset, old_changeset):
         if not self.notify: