# HG changeset patch # User Thomas De Schampheleire # Date 1476200740 -7200 # Node ID 84099c5e092034542419fd5792f1e9b02110e520 # Parent 2ae737b2dbdc2d90860db20d182137f1c98457fa 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', ... diff -r 2ae737b2dbdc -r 84099c5e0920 kallithea/model/notification.py --- 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: