Add unsubscribe links to digest e-mails.

(imported from commit 4e2a324decf4bc694752cc24b9085361338a08a5)
This commit is contained in:
Jessica McKellar
2013-12-01 19:39:10 -05:00
parent 1b068d5433
commit 207cfc449d
5 changed files with 37 additions and 7 deletions

View File

@@ -1223,6 +1223,19 @@ def do_change_enable_offline_push_notifications(user_profile, offline_push_notif
'user': user_profile.email,
'enable_offline_push_notifications': offline_push_notifications})
def do_change_enable_digest_emails(user_profile, enable_digest_emails, log=True):
user_profile.enable_digest_emails = enable_digest_emails
user_profile.save(update_fields=["enable_digest_emails"])
if not enable_digest_emails:
# Remove any digest emails that have been enqueued.
clear_followup_emails_queue(user_profile.email)
if log:
log_event({'type': 'enable_digest_emails',
'user': user_profile.email,
'enable_digest_emails': enable_digest_emails})
def do_change_enter_sends(user_profile, enter_sends):
user_profile.enter_sends = enter_sends
user_profile.save(update_fields=["enter_sends"])