Send a confirmation email when an account is created. Links don't do anything yet.

This commit is contained in:
yackob03 2013-09-27 19:29:01 -04:00
parent 87dc3b6344
commit 99341f7d53
8 changed files with 73 additions and 7 deletions

20
util/email.py Normal file
View file

@ -0,0 +1,20 @@
from flask.ext.mail import Message
from app import mail, app
CONFIRM_MESSAGE = """
This email address was recently used to register the username '%s'
at <a href="http://quay.io">Quay.io</a>.<br>
<br>
To confirm this email address, please click the following link:<br>
<a href="http://quay.io/confirm?token=%s">http://quay.io/confirm?token=%s</a>
"""
def send_confirmation_email(username, email, token):
msg = Message('Welcome to Quay! Please confirm your email.',
sender='support@fluxmonkey.io', # Why do I need this?
recipients=[email])
msg.html = CONFIRM_MESSAGE % (username, token, token)
mail.send(msg)