Work in progress: Require invite acceptance to join an org

This commit is contained in:
Joseph Schorr 2014-08-15 17:47:43 -04:00
parent f6f857eec2
commit 56d7a3524d
9 changed files with 157 additions and 13 deletions

View file

@ -65,6 +65,19 @@ To confirm this email address, please click the following link:<br>
<a href="%s/authrepoemail?code=%s">%s/authrepoemail?code=%s</a>
"""
INVITE_TO_ORG_TEAM_MESSAGE = """
Hi {0},<br>
{1} has invited you to join the team {2} under organization {3} on <a href="{4}">{5}</a>.
<br><br>
To join the team, please click the following link:<br>
<a href="{4}/confirminvite?code={6}">{4}/confirminvite?code={6}</a>
<br><br>
If you were not expecting this invitation, you can ignore this email.
<br><br>
Thanks,<br>
- {5} Support
"""
SUBSCRIPTION_CHANGE_TITLE = 'Subscription Change - {0} {1}'
@ -123,3 +136,14 @@ def send_payment_failed(customer_email, quay_username):
recipients=[customer_email])
msg.html = PAYMENT_FAILED.format(quay_username)
mail.send(msg)
def send_org_invite_email(member_name, member_email, orgname, team, adder, code):
app_title = app.config['REGISTRY_TITLE_SHORT']
app_url = get_app_url()
title = '%s has invited you to join a team in %s' % (adder, app_title)
msg = Message(title, sender='support@quay.io', recipients=[member_email])
msg.html = INVITE_TO_ORG_TEAM_MESSAGE.format(member_name, adder, team, orgname,
app_url, app_title, code)
mail.send(msg)