Merge branch 'master' of ssh://bitbucket.org/yackob03/quay
This commit is contained in:
commit
9c20560e91
1 changed files with 28 additions and 0 deletions
28
tools/sendconfirmemail.py
Normal file
28
tools/sendconfirmemail.py
Normal file
|
@ -0,0 +1,28 @@
|
|||
from app import stripe
|
||||
from app import app
|
||||
|
||||
from util.email import send_confirmation_email
|
||||
|
||||
from data import model
|
||||
|
||||
import argparse
|
||||
|
||||
from flask import Flask, current_app
|
||||
from flask_mail import Mail
|
||||
|
||||
def sendConfirmation(username):
|
||||
user = model.get_user(username)
|
||||
if not user:
|
||||
print 'No user found'
|
||||
return
|
||||
|
||||
|
||||
with app.app_context():
|
||||
code = model.create_confirm_email_code(user)
|
||||
send_confirmation_email(user.username, user.email, code.code)
|
||||
print 'Email sent to %s' % (user.email)
|
||||
|
||||
parser = argparse.ArgumentParser(description='Sends a confirmation email')
|
||||
parser.add_argument('username', help='The username')
|
||||
args = parser.parse_args()
|
||||
sendConfirmation(args.username)
|
Reference in a new issue