diff options
Diffstat (limited to 'pyaggr3g470r/emails.py')
-rw-r--r-- | pyaggr3g470r/emails.py | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/pyaggr3g470r/emails.py b/pyaggr3g470r/emails.py index c4bcb61f..9507d3ae 100644 --- a/pyaggr3g470r/emails.py +++ b/pyaggr3g470r/emails.py @@ -70,7 +70,25 @@ def new_account_notification(user): try: 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) - + + message = PMMail(api_key = conf.POSTMARK_API_KEY, + subject = "[pyAggr3g470r] Account activation", + sender = conf.ADMIN_EMAIL, + to = user.email, + text_body = plaintext) + + message.send() + except Exception as e: + raise e + else: + pass + +def new_account_activation(user): + if conf.ON_HEROKU: + try: + plaintext = """Hello,\n\nYour account has been activated. You can now connect to the platform:\n%s\n\nSee you,""" % \ + (conf.PLATFORM_URL) + message = PMMail(api_key = conf.POSTMARK_API_KEY, subject = "[pyAggr3g470r] Account activation", sender = conf.ADMIN_EMAIL, @@ -82,8 +100,6 @@ def new_account_notification(user): raise e else: pass - - def new_article_notification(user, feed, article): send_email(conf.ADMIN_EMAIL, user.email, feed, article)
\ No newline at end of file |