Merge pull request #1674 from coreos-inc/new-quay-emails

New quay emails
This commit is contained in:
Ben Spoon 2016-08-09 09:12:54 -07:00 committed by GitHub
commit b0e34692cf
15 changed files with 353 additions and 75 deletions

View file

@ -74,7 +74,7 @@ def admin_reference(username):
if user.organization:
return """
<a href="%s/organization/%s/admin">organization's admin setting</a>
<a href="%s/organization/%s?tab=settings">organization's admin setting</a>
""" % (get_app_url(), username)
else:
return """

View file

@ -1,6 +1,7 @@
import logging
import traceback
import json
import features
from flask.ext.mail import Message
@ -53,18 +54,15 @@ def send_email(recipient, subject, template_file, parameters, action=None):
app_title = app.config['REGISTRY_TITLE_SHORT']
app_url = get_app_url()
def app_link_handler(url=None, title=None):
real_url = app_url + '/' + url if url else app_url
if not title:
title = real_url if url else app_title
return '<a href="%s">%s</a>' % (real_url, title)
def app_link_handler(url=None):
return app_url + '/' + url if url else app_url
parameters.update({
'subject': subject,
'app_logo': 'https://quay.io/static/img/quay-logo.png', # TODO: make this pull from config
'app_url': app_url,
'app_title': app_title,
'hosted': features.BILLING,
'app_link': app_link_handler,
'action_metadata': json.dumps(action.metadata) if action else None
})