aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/emails.py
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2014-05-13 21:33:16 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2014-05-13 21:33:16 +0200
commit55dd4537491462454ffa1b3612387260811a07c7 (patch)
tree1056c055ac8d12ef2cb2897adacb5517613b7102 /pyaggr3g470r/emails.py
parentDisplay user activation key? (diff)
downloadnewspipe-55dd4537491462454ffa1b3612387260811a07c7.tar.gz
newspipe-55dd4537491462454ffa1b3612387260811a07c7.tar.bz2
newspipe-55dd4537491462454ffa1b3612387260811a07c7.zip
Test with postmark OK.
Diffstat (limited to 'pyaggr3g470r/emails.py')
-rw-r--r--pyaggr3g470r/emails.py31
1 files changed, 16 insertions, 15 deletions
diff --git a/pyaggr3g470r/emails.py b/pyaggr3g470r/emails.py
index e9d3b418..c4bcb61f 100644
--- a/pyaggr3g470r/emails.py
+++ b/pyaggr3g470r/emails.py
@@ -59,28 +59,29 @@ def send_email(mfrom, mto, feed, article):
else:
s.sendmail(mfrom, mto, msg.as_string())
s.quit()
-
+
#
# Notifications
#
def new_account_notification(user):
- try:
- plaintext = """Hello,\n\nYour account has been created. Click on the following link to confirm it:\n%s""" % \
- (conf.PLATFORM_URL + 'confirm_account/' + user.activation_key)
- #plaintext = utils.clear_string(html)
-
-
- message = PMMail(api_key = conf.POSTMARK_API_KEY,
- subject = "[pyAggr3g470r] Account activation",
- sender = conf.ADMIN_EMAIL,
- to = user.email,
- text_body = plaintext)
+ if conf.ON_HEROKU:
+ 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
+ message.send()
+ except Exception as e:
+ raise e
+ else:
+ pass
bgstack15