changeset 6275:84099c5e0920

email: add X-Kallithea-Notification-Type header To simplify email filtering, add a header indicating the type of email being sent. The 'type_' value corresponds to one of the types defined in class Notification in kallithea/model/db.py, e.g. 'cs_comment', 'pull_request', 'pull_request_comment', ...
author Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
date Tue, 11 Oct 2016 17:45:40 +0200
parents 2ae737b2dbdc
children 5ae3fff8994e
files kallithea/model/notification.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/model/notification.py	Sun Oct 09 21:42:11 2016 +0200
+++ b/kallithea/model/notification.py	Tue Oct 11 17:45:40 2016 +0200
@@ -102,9 +102,10 @@
         #don't send email to person who created this comment
         rec_objs = set(recipients_objs).difference(set([created_by_obj]))
 
-        headers = None
+        headers = {}
+        headers['X-Kallithea-Notification-Type'] = type_
         if 'threading' in email_kwargs:
-            headers = {'References': ' '.join('<%s>' % x for x in email_kwargs['threading'])}
+            headers['References'] = ' '.join('<%s>' % x for x in email_kwargs['threading'])
 
         # send email with notification to all other participants
         for rec in rec_objs: