Changeset - c25392980f91
[Not reviewed]
stable
0 1 0
Thomas De Schampheleire - 9 years ago 2016-10-11 17:45:40
thomas.de.schampheleire@gmail.com
Grafted from: 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', ...
1 file changed with 3 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/model/notification.py
Show inline comments
 
@@ -114,9 +114,10 @@ class NotificationModel(BaseModel):
 
        #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:
0 comments (0 inline, 0 general)