mediagoblin.util.send_email now supports both list() and string() in the 'to_addrs' parameter
Signed-off-by: Joar Wandborg <git@wandborg.com>
This commit is contained in:
parent
67e63926f9
commit
85e1bc316e
@ -163,7 +163,8 @@ def send_email(from_addr, to_addrs, subject, message_body):
|
||||
message = MIMEText(message_body.encode('utf-8'), 'plain', 'utf-8')
|
||||
message['Subject'] = subject
|
||||
message['From'] = from_addr
|
||||
message['To'] = ', '.join(to_addrs)
|
||||
# The shorthand condition takes height for the possibility that the to_addrs argument can be either list() or string()
|
||||
message['To'] = ', '.join(to_addrs) if type( to_addrs ) == list else to_addrs
|
||||
|
||||
if TESTS_ENABLED:
|
||||
EMAIL_TEST_INBOX.append(message)
|
||||
|
Loading…
x
Reference in New Issue
Block a user