mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
notify: add X-AUR-Reason header to allow conveniently filtering emails
Because filtering by matching the sender && regular expressions on the subject is awkward. Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
This commit is contained in:
parent
44af2b430f
commit
e0d821352f
1 changed files with 4 additions and 0 deletions
|
@ -63,6 +63,9 @@ class Notification:
|
||||||
sendmail = aurweb.config.get('notifications', 'sendmail')
|
sendmail = aurweb.config.get('notifications', 'sendmail')
|
||||||
sender = aurweb.config.get('notifications', 'sender')
|
sender = aurweb.config.get('notifications', 'sender')
|
||||||
reply_to = aurweb.config.get('notifications', 'reply-to')
|
reply_to = aurweb.config.get('notifications', 'reply-to')
|
||||||
|
reason = self.__class__.__name__
|
||||||
|
if reason.endswith('Notification'):
|
||||||
|
reason = reason[:-len('Notification')]
|
||||||
|
|
||||||
for recipient in self.get_recipients():
|
for recipient in self.get_recipients():
|
||||||
to, lang = recipient
|
to, lang = recipient
|
||||||
|
@ -72,6 +75,7 @@ class Notification:
|
||||||
msg['From'] = sender
|
msg['From'] = sender
|
||||||
msg['Reply-to'] = reply_to
|
msg['Reply-to'] = reply_to
|
||||||
msg['To'] = to
|
msg['To'] = to
|
||||||
|
msg['X-AUR-Reason'] = reason
|
||||||
|
|
||||||
for key, value in self.get_headers().items():
|
for key, value in self.get_headers().items():
|
||||||
msg[key] = value
|
msg[key] = value
|
||||||
|
|
Loading…
Add table
Reference in a new issue