diff roundup/roundupdb.py @ 5750:2c0f89edabe1

issue2551043: Add X-Roundup-issue-id email header. Add a new header to make it easier to filter notification emails without having to parse the subject line. Modified tests to account for new header.
author John Rouillard <rouilj@ieee.org>
date Sat, 01 Jun 2019 13:19:14 -0400
parents f3d68c1bb96e
children 11a9c5b2efd4
line wrap: on
line diff
--- a/roundup/roundupdb.py	Sat Jun 01 09:05:23 2019 -0400
+++ b/roundup/roundupdb.py	Sat Jun 01 13:19:14 2019 -0400
@@ -595,6 +595,16 @@
                 except UnicodeError:
                     message[header] = Header(values, charset)
 
+            # Add header for main id number to make filtering
+            # email easier than extracting from subject line.
+            header = "X-Roundup-%s-Id"%(self.classname)
+            values = issueid
+            try:
+                values.encode('ascii')
+                message[header] = values
+            except UnicodeError:
+                message[header] = Header(values, charset)
+
             if not inreplyto:
                 # Default the reply to the first message
                 msgs = self.get(issueid, 'messages')

Roundup Issue Tracker: http://roundup-tracker.org/