projects
/
matthijs
/
projects
/
xerxes.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
63cf915
)
* Let notify filter out Subject and From headers from the headers in the template...
author
Matthijs Kooijman
<matthijs@stdin.nl>
Thu, 31 Jan 2008 17:29:29 +0000
(18:29 +0100)
committer
Matthijs Kooijman
<matthijs@stdin.nl>
Thu, 31 Jan 2008 17:29:29 +0000
(18:29 +0100)
tools/notify.py
patch
|
blob
|
history
diff --git
a/tools/notify.py
b/tools/notify.py
index 4530255510787754beaaaa670aad191e4aa2fab8..08bc47761f82f8247a19896f07ea9573d753a14e 100644
(file)
--- a/
tools/notify.py
+++ b/
tools/notify.py
@@
-36,14
+36,20
@@
def notify(recipients, template, context = {}):
from_email = None
for header in headers.split('\n'):
(field, value) = header.split(':')
from_email = None
for header in headers.split('\n'):
(field, value) = header.split(':')
- headers_dict[field] = value
if (field == 'From'):
from_email = value
if (field == 'From'):
from_email = value
+ elif (field == 'Subject'):
+ subject = value
+ else:
+ # Don't put From and Subject in the dict, else they'll be
+ # present twice.
+ headers_dict[field] = value
msg = EmailMessage(
# Only setting the From address through headers won't set the
# envelope address right.
from_email = from_email,
msg = EmailMessage(
# Only setting the From address through headers won't set the
# envelope address right.
from_email = from_email,
+ subject = subject,
body = body,
to = addresses,
headers = headers_dict
body = body,
to = addresses,
headers = headers_dict