emails: only show quay footer if coming from hosted

This commit is contained in:
Ben Spoon 2016-08-04 11:48:53 -07:00
parent 46a720285a
commit 004b834c72
3 changed files with 6 additions and 1 deletions

View file

@ -53,6 +53,7 @@
</td>
<td style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; margin: 0; padding: 0;"></td>
</tr></table><!-- /BODY -->
{% if hosted %}
<table style="text-align:center; margin:25px auto 0;">
<tr>
<td style="font-size: 13px; font-weight: 200">Quay [ builds, analyzes, distributes ] your container images</td>
@ -65,5 +66,6 @@
<td><a style="color: #52A3D9;" href="https://www.quay.io">Quay.io</a></td>
</tr>
</table>
{% endif %}
</body>
</html>

View file

@ -27,6 +27,7 @@ app.jinja_env.filters['admin_reference'] = admin_reference
app.jinja_env.filters['repository_reference'] = repository_reference
app.jinja_env.filters['team_reference'] = team_reference
app_title = 'Quay.io (local)'
def app_link_handler(url=None, title=None):
""" Just because it is in the original email tempaltes """
@ -37,7 +38,8 @@ def render_with_options(template=None):
return render_template(template, username="exampleuser", user_reference="testing",
app_logo="https://quay.io/static/img/quay-horizontal-color.svg", token="sdf8SdfKGRME9dse_dfdf",
app_link=app_link_handler, namespace="booboo", repository="foobar", organization="buynlarge",
admin_usernames=["lazercat", "booboocoreos"], teamname="creators", inviter="devtable")
admin_usernames=["lazercat", "booboocoreos"], teamname="creators", inviter="devtable",
hosted = "Quay" in app_title, app_title = app_title)
def get_templates():
""" Return a list of the available templates """

View file

@ -61,6 +61,7 @@ def send_email(recipient, subject, template_file, parameters, action=None):
'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': 'Quay' in app_title,
'app_link': app_link_handler,
'action_metadata': json.dumps(action.metadata) if action else None
})