def send_delete_topic_email(email, topic): token = gen_salt(16) key = 'account:delete-topic:%s' % token redis.set(key, topic.id, ONE_DAY) url = full_url('account.delete_topic', token=token) title = 'Deteting %s' % topic.title text = '%s\n\n%s' % (title, url) run_task(send_text, email, title, text)
def social_login(name): remote = SocialUser.get_remote_app(name) if not remote: abort(404) session['next_url'] = request.referrer or '/' callback = full_url('.social_authorize', name=name) return remote.authorize(callback=callback)
def send_change_password_email(email): token = create_email_signature(email, 'password') title = 'Change password for %s' % current_app.config['SITE_NAME'] url = full_url('account.change_password', token=token) text = '%s\n\n%s' % (title, url) run_task(send_text, email, title, text)
def send_signup_email(email): token = create_email_signature(email, 'signup') url = full_url('account.signup', token=token) title = 'Sign up account for %s' % current_app.config['SITE_NAME'] text = '%s\n\n%s' % (title, url) run_task(send_text, email, title, text)