From be992ebb57dcd40751fa8887da74f912a7228fd2 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Tue, 20 May 2014 08:04:10 +0200 Subject: Real FFix --- pyaggr3g470r/emails.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'pyaggr3g470r') diff --git a/pyaggr3g470r/emails.py b/pyaggr3g470r/emails.py index 2bee64cf..77546138 100644 --- a/pyaggr3g470r/emails.py +++ b/pyaggr3g470r/emails.py @@ -72,13 +72,11 @@ def send_heroku(user=None, bcc="", subject="", plaintext=""): try: message = PMMail(api_key = conf.POSTMARK_API_KEY, subject = subject, - to = user.email, sender = conf.ADMIN_EMAIL, text_body = plaintext) - if bcc != "" and None == user: + if bcc != "": message.bcc = bcc - message.to = "" - elif bcc == "" and None != user: + elif bcc == "": message.to = user.email message.send() except Exception as e: @@ -106,7 +104,7 @@ def new_account_notification(user): plaintext = """Hello,\n\nYour account has been created. Click on the following link to confirm it:\n%s\n\nSee you,""" % \ (conf.PLATFORM_URL + 'confirm_account/' + user.activation_key) if conf.ON_HEROKU: - send_heroku(user=user, bcc="", subject="[pyAggr3g470r] Account creation", plaintext=plaintext) + send_heroku(user=user, subject="[pyAggr3g470r] Account creation", plaintext=plaintext) else: pass @@ -117,7 +115,7 @@ def new_account_activation(user): plaintext = """Hello,\n\nYour account has been activated. You can now connect to the platform:\n%s\n\nSee you,""" % \ (conf.PLATFORM_URL) if conf.ON_HEROKU: - send_heroku(user=user, bcc="", subject="[pyAggr3g470r] Account activated", plaintext=plaintext) + send_heroku(user=user, subject="[pyAggr3g470r] Account activated", plaintext=plaintext) else: pass -- cgit