# HG changeset patch # User Goffi # Date 1499259772 -7200 # Node ID 666ad9de044c3bc48854c213669fb6a3bbfc1277 # Parent 37887b5acb2503c2dec1a1298d6806f93c65fba3 core (tools/email): an unicode "to" email (instead of a list) can now be used diff -r 37887b5acb25 -r 666ad9de044c src/tools/email.py --- a/src/tools/email.py Wed Jul 05 14:50:45 2017 +0200 +++ b/src/tools/email.py Wed Jul 05 15:02:52 2017 +0200 @@ -31,12 +31,15 @@ def sendEmail(host, to_emails, subject=u'', body=u'', from_email=None): """send an email using SàT configuration - @param to_emails(list[unicode]): list of recipients + @param to_emails(list[unicode], unicode): list of recipients + if unicode, it will be split to get emails @param subject(unicode): subject of the message @param body(unicode): body of the message @param from_email(unicode): address of the sender @return (D): same as smtp.sendmail """ + if isinstance(to_emails, basestring): + to_emails = to_emails.split() email_host = host.memory.getConfig(None, u'email_server') or u'localhost' email_from = host.memory.getConfig(None, u'email_from') if email_from is None: