def followup(dry_run):
if dry_run:
print("DRY RUN -- Not sending actual emails")
config['DEBUG'] = True
"Run after changing the question schema; sends out email updates. Recommended at most once per month."
emails = []
usrs = []
for user in r.table('users').run(conn()):
if 'subscribed' not in user or user['subscribed'] == False:
# Ignore anonymous or unsubscribed users
continue
# Get email for email/xenforo accounts
usrs.append(user)
emails.append(user['email'] if 'email' in user else user['identity'])
print("Sending emails to the following %s users", (len(emails), emails))
desc = sys.stdin.read()
for user in usrs:
users.mail(user, 'Questions have been updated',
"""You are receiving this email because the questions have been updated. Please consider logging in and updating your response.<br>
<br>
Update notes:<br>
%s<br>
""" % desc.replace('\n', '<br>'),
"""You are receiving this email because the questions have been updated. Please conisder logging in and updating your response\n
\n
Update notes:%s\n""" % desc, use_flash = False)
评论列表
文章目录