summaryrefslogtreecommitdiff
path: root/postgresqleu/mailqueue/util.py
diff options
context:
space:
mode:
authorMagnus Hagander2018-12-19 20:03:13 +0000
committerMagnus Hagander2018-12-19 20:03:13 +0000
commitb71591f13ba8fc03453a8b445ec61bfdc1e4ebba (patch)
tree2cf41e4d6f4fde2f3e58f8ef6f08269a31fb8705 /postgresqleu/mailqueue/util.py
parent253f30dc0c66bb70a4b8590874ea57bc06605aaa (diff)
Add ability to add extra bcc addresses to invoices
This can be a list (comma separated) of email addresses that will receive a BCC of all emails about this invoice. This is similar to how the treasurer address gets such a copy, but makes it possible to add more than one address.
Diffstat (limited to 'postgresqleu/mailqueue/util.py')
-rw-r--r--postgresqleu/mailqueue/util.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/postgresqleu/mailqueue/util.py b/postgresqleu/mailqueue/util.py
index f2a66ced..be69d287 100644
--- a/postgresqleu/mailqueue/util.py
+++ b/postgresqleu/mailqueue/util.py
@@ -57,7 +57,13 @@ def send_simple_mail(sender, receiver, subject, msgtxt, attachments=None, bcc=No
QueuedMail(sender=sender, receiver=receiver, fullmsg=msg.as_string()).save()
# Any bcc is just entered as a separate email
if bcc:
- QueuedMail(sender=sender, receiver=bcc, fullmsg=msg.as_string()).save()
+ if type(bcc) is list or type(bcc) is tuple:
+ bcc = set(bcc)
+ else:
+ bcc = set(bcc, )
+
+ for b in bcc:
+ QueuedMail(sender=sender, receiver=b, fullmsg=msg.as_string()).save()
def send_mail(sender, receiver, fullmsg):