From 195f0bb5d8fa87771c4ea3208fc79d642f52fdca Mon Sep 17 00:00:00 2001 From: Ben Spoon Date: Tue, 2 Aug 2016 14:57:38 -0700 Subject: [PATCH 01/11] emails: add email template viewer --- emails/email-template-viewer.html | 17 ++++++ tools/email-viewer/emails.py | 87 +++++++++++++++++++++++++++++ tools/email-viewer/requirements.txt | 6 ++ 3 files changed, 110 insertions(+) create mode 100644 emails/email-template-viewer.html create mode 100644 tools/email-viewer/emails.py create mode 100644 tools/email-viewer/requirements.txt diff --git a/emails/email-template-viewer.html b/emails/email-template-viewer.html new file mode 100644 index 000000000..f3f6f9a38 --- /dev/null +++ b/emails/email-template-viewer.html @@ -0,0 +1,17 @@ + + + + Email Template Viewer + + +

Email Template Viewer

+ Here is a list of the templates available: + + + \ No newline at end of file diff --git a/tools/email-viewer/emails.py b/tools/email-viewer/emails.py new file mode 100644 index 000000000..9af305dcc --- /dev/null +++ b/tools/email-viewer/emails.py @@ -0,0 +1,87 @@ +from flask import Flask, render_template +import datetime +import os + +tmpl_dir = '../../emails' + +app = Flask(__name__, template_folder=tmpl_dir) + +@app.template_filter() +def user_reference_filter(value): + return value + +@app.template_filter() +def admin_reference(value): + return value + +@app.template_filter() +def repository_reference(value): + return value + +@app.template_filter() +def team_reference(value): + return value + +app.jinja_env.filters['user_reference'] = user_reference_filter +app.jinja_env.filters['admin_reference'] = admin_reference +app.jinja_env.filters['repository_reference'] = repository_reference +app.jinja_env.filters['team_reference'] = team_reference + + +def app_link_handler(url=None, title=None): + """ Just because it is in the original email tempaltes """ + return 'http://example.com/example' + +def render_with_options(template=None): + """ Pass a bunch of common variables when rendering templates """ + 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") + +def get_templates(): + """ Return a list of the available templates """ + return [t.replace('.html', '') for t in os.listdir('../../emails')] + +@app.route("/") +def template_test(): + return render_template('email-template-viewer.html', templates=get_templates()) + +@app.route("/changeemail") +def changeemail(): + return render_with_options('changeemail.html'); + +@app.route("/confirmemail") +def confirmemail(): + return render_with_options('confirmemail.html'); + +@app.route("/emailchanged") +def emailchanged(): + return render_with_options('emailchanged.html'); + +@app.route("/orgrecovery") +def orgrecovery(): + return render_with_options('orgrecovery.html'); + +@app.route("/passwordchanged") +def passwordchanged(): + return render_with_options('passwordchanged.html'); + +@app.route("/paymentfailure") +def paymentfailure(): + return render_with_options('paymentfailure.html'); + +@app.route("/recovery") +def recovery(): + return render_with_options('recovery.html'); + +@app.route("/repoauthorizeemail") +def repoauthorizeemail(): + return render_with_options('repoauthorizeemail.html'); + +@app.route("/teaminvite") +def teaminvite(): + return render_with_options('teaminvite.html'); + +if __name__ == '__main__': + app.run(debug=True) diff --git a/tools/email-viewer/requirements.txt b/tools/email-viewer/requirements.txt new file mode 100644 index 000000000..145e30200 --- /dev/null +++ b/tools/email-viewer/requirements.txt @@ -0,0 +1,6 @@ +Flask==0.10.1 +Jinja2==2.7.2 +MarkupSafe==0.18 +Werkzeug==0.9.4 +itsdangerous==0.23 +wsgiref==0.1.2 From 39816a57acece4b0bcff90077372db42e6a31ba0 Mon Sep 17 00:00:00 2001 From: Ben Spoon Date: Tue, 2 Aug 2016 14:57:50 -0700 Subject: [PATCH 02/11] emails: change email templates to new design --- emails/base.html | 28 +++++++++++++++---- emails/changeemail.html | 21 +++++++++++--- emails/confirmemail.html | 29 +++++++++++++++---- emails/emailchanged.html | 27 ++++++++++++++---- emails/orgrecovery.html | 51 +++++++++++++++++++++++++--------- emails/passwordchanged.html | 29 +++++++++++++++---- emails/paymentfailure.html | 29 +++++++++++++++---- emails/recovery.html | 34 +++++++++++++++-------- emails/repoauthorizeemail.html | 27 ++++++++++++++---- emails/teaminvite.html | 27 +++++++++++++----- 10 files changed, 234 insertions(+), 68 deletions(-) diff --git a/emails/base.html b/emails/base.html index 00a89e51d..f439b6837 100644 --- a/emails/base.html +++ b/emails/base.html @@ -11,7 +11,7 @@ {% endif %} - - +
-
- +
{{ app_title }}
{{ app_title }}
-
+
+
{% block content %}{% endblock %} + +
+
+ + +
If you have any questions, respond to this email and we’ll be happy to help!
+ + + + +
Quay [ builds, analyzes, distributes ] your container images
+ + + + + + +
Your AccountDocumentationQuay.io
diff --git a/emails/changeemail.html b/emails/changeemail.html index ee9b909fc..77313bf95 100644 --- a/emails/changeemail.html +++ b/emails/changeemail.html @@ -2,12 +2,25 @@ {% block content %} -

E-mail Address Change Requested

+

E-mail Address Change Requested

+
+This email address was added to the Quay account {{username}}. -This email address was recently asked to become the new e-mail address for user {{ username | user_reference }}. + + + + +
Confirm Email
+ + + + +
If you did not add this address to {{username}}, you can safely ignore this message.
+Best Regards, +
+The Quay Team

-To confirm this change, please click the following link:
-{{ app_link('confirm?code=' + token) }} + {% endblock %} diff --git a/emails/confirmemail.html b/emails/confirmemail.html index de94372cd..6e26aab5d 100644 --- a/emails/confirmemail.html +++ b/emails/confirmemail.html @@ -2,12 +2,29 @@ {% block content %} -

Please Confirm E-mail Address

+

Confirm email for new user: {{ username }}

+
-This email address was recently used to register user {{ username | user_reference }}. -
-
-To confirm this email address, please click the following link:
-{{ app_link('confirm?code=' + token) }} + + + + +
This email address was user to register user {{ username }}.
+ + + + + +
Once you confirm this email you’ll be able to access your Quay account.
+ + + + + +
Confirm Email
+ + +Welcome!
+The Quay Team
{% endblock %} diff --git a/emails/emailchanged.html b/emails/emailchanged.html index ce6de5565..47ade4836 100644 --- a/emails/emailchanged.html +++ b/emails/emailchanged.html @@ -2,11 +2,28 @@ {% block content %} -

Account E-mail Address Changed

+

Account password changed: {{ username }}

+
-The email address for user {{ username | user_reference }} has been changed from this e-mail address to {{ new_email }}. -
-
-If this change was not expected, please immediately log into your {{ username | admin_reference }} and reset your email address. + + + + +
The password for user {{ username }} has been changed.
+ + + + + +
No action is required if you made this change.
+ + + + + +
If you did not make this change, please contact support
+ +Best wishes,
+The Quay Team
{% endblock %} diff --git a/emails/orgrecovery.html b/emails/orgrecovery.html index cda1d17e0..3ab95660e 100644 --- a/emails/orgrecovery.html +++ b/emails/orgrecovery.html @@ -2,19 +2,44 @@ {% block content %} -

Organization {{ organization }} recovery

+

Organization recovery: {{ organization }}

+
-A user at {{ app_link() }} has attempted to recover organization {{ organization | user_reference }} via this email address. -
-
-Please login with one of the following user accounts to access this organization: -
    -{% for admin_user in admin_usernames %} -
  • {{ admin_user | user_reference }}
  • -{% endfor %} -
-
-If you did not make this request, your organization has not been compromised and the user was -not given access. Please disregard this email. + + + + +
A user at {{ app_link() }} has attempted to recover access to organization {{ organization }} via this email address.
+ + + + + +
Please login with one of the following user accounts to access this organization:
+ + +
    + {% for admin_user in admin_usernames %} +
  • {{ admin_user | user_reference }}
  • + {% endfor %} +
+ +
+ + + + + +
Login to Recover
+ + + + + +
If you did not make this request, your organization has not been compromised and the user was not given access. You can safely ignore this message.
+ + +Best Wishes,
+The Quay Team
{% endblock %} diff --git a/emails/passwordchanged.html b/emails/passwordchanged.html index 07c6232cc..6d4330860 100644 --- a/emails/passwordchanged.html +++ b/emails/passwordchanged.html @@ -2,12 +2,29 @@ {% block content %} -

Account Password Changed

+

Account password changed: {{ username }}

+
-The password for user {{ username | user_reference }} has been updated. -
-
-If this change was not expected, please immediately log into your account settings and reset your email address, -or contact support. + + + + +
The password for user {{ username }} has been changed
+ + + + + +
No action is required if you made this change
+ + + + + +
If you did not make this change, please contact support
+ + +Best Wishes,
+The Quay Team
{% endblock %} diff --git a/emails/paymentfailure.html b/emails/paymentfailure.html index 790f590b4..395e574a3 100644 --- a/emails/paymentfailure.html +++ b/emails/paymentfailure.html @@ -2,12 +2,29 @@ {% block content %} -

Subscription Payment Failure

+

Subscription payment failure: {{ username }}

+
-Your recent payment for account {{ username | user_reference }} failed, which usually results in our payments processor canceling -your subscription automatically. If you would like to continue to use {{ app_title }} without interruption, -please add a new card to {{ app_title }} and re-subscribe to your plan.
-
-You can find the card and subscription management features under your {{ username | admin_reference }}
+ + + + +
A recent payment for account {{ username }} failed.
+ + + + + +
If you would like to continue to use the account {{ username }} without interruption, update your payment information.
+ + + + + + +
Log in to update payment info
+ +Thank you,
+The Quay Team
{% endblock %} diff --git a/emails/recovery.html b/emails/recovery.html index 6f0267e39..7c6fe4ccf 100644 --- a/emails/recovery.html +++ b/emails/recovery.html @@ -2,17 +2,29 @@ {% block content %} -

Account recovery

+

Account recovery

+
-A user at {{ app_link() }} has attempted to recover their account -using this email address. -
-
-If you made this request, please click the following link to recover your account and -change your password: -{{ app_link('recovery?code=' + token) }} -

-If you did not make this request, your account has not been compromised and the user was -not given access. Please disregard this email. + + + + +
A user at Quay.io (local) has attempted to recover their access to the account registered to this email address
+ + + + + +
Recover Account
+ + + + + +
If you did not request this password reset, you can safely ignore this message and the account password and access will not change.
+ + +Best Wishes,
+The Quay Team
{% endblock %} diff --git a/emails/repoauthorizeemail.html b/emails/repoauthorizeemail.html index 7ae33975c..3f7b6e391 100644 --- a/emails/repoauthorizeemail.html +++ b/emails/repoauthorizeemail.html @@ -2,12 +2,29 @@ {% block content %} -

Verify e-mail to receive repository notifications

+

Verify e-mail to recieve {{namespace}}/{{repository}} notifications

+
-A request has been made to send notifications to this email address for repository {{ (namespace, repository) | repository_reference }} + + + + +
A request has been made to send notifications to this email address for the repository {{namespace}}/{{repository}}
-

-To verify this email address, please click the following link:
-{{ app_link('authrepoemail?code=' + token) }} + + + + +
Confirm Email
+ + + + + +
If you do not wish to receive notifications for {{namespace}}/{{repository}}, you can ignore this message.
+ + +Thank you,
+The Quay Team
{% endblock %} diff --git a/emails/teaminvite.html b/emails/teaminvite.html index 128bbe00f..ff757f013 100644 --- a/emails/teaminvite.html +++ b/emails/teaminvite.html @@ -2,16 +2,29 @@ {% block content %} -

Invitation to join team: {{ teamname }}

+

Invitation to join team: {{ organization }}/{{ teamname }}

+
-{{ inviter | user_reference }} has invited you to join the team {{ teamname | team_reference }} under organization {{ organization | user_reference }}. + + + + +
You’ve been invited to join the team {{ teamname }} in the organization {{ organization }} by user {{ inviter | user_reference }}.
-

+ + + + +
Join Team
-To join the team, please click the following link:
-{{ app_link('confirminvite?code=' + token) }} + + + + +
If you were not expecting this invitation, you can safely ignore this email.
-

-If you were not expecting this invitation, you can ignore this email. + +Thank you,
+The Quay Team
{% endblock %} From 7d940d30c15a9e098909e9264865b19b35ebbdc0 Mon Sep 17 00:00:00 2001 From: Ben Spoon Date: Tue, 2 Aug 2016 15:09:44 -0700 Subject: [PATCH 03/11] emails: add missing login link --- emails/base.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emails/base.html b/emails/base.html index f439b6837..b6b70c704 100644 --- a/emails/base.html +++ b/emails/base.html @@ -60,7 +60,7 @@ - + From 468160cc3d593df6f63829ee4389bfe607737c73 Mon Sep 17 00:00:00 2001 From: Ben Spoon Date: Tue, 2 Aug 2016 15:13:37 -0700 Subject: [PATCH 04/11] emails: add missing support link --- emails/emailchanged.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emails/emailchanged.html b/emails/emailchanged.html index 47ade4836..db7996a82 100644 --- a/emails/emailchanged.html +++ b/emails/emailchanged.html @@ -19,7 +19,7 @@
Your AccountYour Account Documentation Quay.io
- +
If you did not make this change, please contact supportIf you did not make this change, please contact support
From 5019ef0b6b480ff0509ed388aae3253d301834c1 Mon Sep 17 00:00:00 2001 From: Ben Spoon Date: Tue, 2 Aug 2016 16:10:04 -0700 Subject: [PATCH 05/11] emails: change the app_link_handler to return just a uri There is no need for an anchor tag any longer. --- util/useremails.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/util/useremails.py b/util/useremails.py index 7320c4155..a82255281 100644 --- a/util/useremails.py +++ b/util/useremails.py @@ -53,12 +53,8 @@ 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 '%s' % (real_url, title) + def app_link_handler(url=None): + return real_url = app_url + '/' + url if url else app_url parameters.update({ 'subject': subject, From 46a720285a15eb9c21fcf5449436c78dbad5c290 Mon Sep 17 00:00:00 2001 From: Ben Spoon Date: Thu, 4 Aug 2016 10:25:25 -0700 Subject: [PATCH 06/11] emails: update payment failure admin link addresses issue #1623 --- util/jinjautil.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/jinjautil.py b/util/jinjautil.py index 1985f6aa4..82e50020a 100644 --- a/util/jinjautil.py +++ b/util/jinjautil.py @@ -74,7 +74,7 @@ def admin_reference(username): if user.organization: return """ - organization's admin setting + organization's admin setting """ % (get_app_url(), username) else: return """ From 004b834c721e4cf0720d465aee96f3e70264a049 Mon Sep 17 00:00:00 2001 From: Ben Spoon Date: Thu, 4 Aug 2016 11:48:53 -0700 Subject: [PATCH 07/11] emails: only show quay footer if coming from hosted --- emails/base.html | 2 ++ tools/email-viewer/emails.py | 4 +++- util/useremails.py | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/emails/base.html b/emails/base.html index b6b70c704..41e3f7bd6 100644 --- a/emails/base.html +++ b/emails/base.html @@ -53,6 +53,7 @@ + {% if hosted %} @@ -65,5 +66,6 @@
Quay [ builds, analyzes, distributes ] your container imagesQuay.io
+ {% endif %} diff --git a/tools/email-viewer/emails.py b/tools/email-viewer/emails.py index 9af305dcc..996970b48 100644 --- a/tools/email-viewer/emails.py +++ b/tools/email-viewer/emails.py @@ -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 """ diff --git a/util/useremails.py b/util/useremails.py index a82255281..44efa9568 100644 --- a/util/useremails.py +++ b/util/useremails.py @@ -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 }) From 16dec047871a6043e9fc574b4746d71316e610df Mon Sep 17 00:00:00 2001 From: Ben Spoon Date: Thu, 4 Aug 2016 11:49:47 -0700 Subject: [PATCH 08/11] emails: use `app_title` in leu of Quay.io --- emails/changeemail.html | 4 ++-- emails/confirmemail.html | 4 ++-- emails/emailchanged.html | 4 ++-- emails/orgrecovery.html | 2 +- emails/passwordchanged.html | 2 +- emails/paymentfailure.html | 2 +- emails/recovery.html | 4 ++-- emails/repoauthorizeemail.html | 2 +- emails/teaminvite.html | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/emails/changeemail.html b/emails/changeemail.html index 77313bf95..663b2f8ef 100644 --- a/emails/changeemail.html +++ b/emails/changeemail.html @@ -4,7 +4,7 @@

E-mail Address Change Requested


-This email address was added to the Quay account {{username}}. +This email address was added to the {{ app_title }} account {{username}}. @@ -18,7 +18,7 @@
Best Regards,
-The Quay Team +The {{ app_title }} Team

diff --git a/emails/confirmemail.html b/emails/confirmemail.html index 6e26aab5d..55b1db157 100644 --- a/emails/confirmemail.html +++ b/emails/confirmemail.html @@ -13,7 +13,7 @@ - +
Once you confirm this email you’ll be able to access your Quay account.Once you confirm this email you’ll be able to access your {{ app_title }} account.
@@ -25,6 +25,6 @@ Welcome!
-The Quay Team
+The {{ app_title }} Team
{% endblock %} diff --git a/emails/emailchanged.html b/emails/emailchanged.html index db7996a82..f5e628d73 100644 --- a/emails/emailchanged.html +++ b/emails/emailchanged.html @@ -23,7 +23,7 @@ -Best wishes,
-The Quay Team
+Best wishes,
+The {{ app_title }} Team
{% endblock %} diff --git a/emails/orgrecovery.html b/emails/orgrecovery.html index 3ab95660e..8d5cd3072 100644 --- a/emails/orgrecovery.html +++ b/emails/orgrecovery.html @@ -40,6 +40,6 @@ Best Wishes,
-The Quay Team
+The {{ app_title }} Team
{% endblock %} diff --git a/emails/passwordchanged.html b/emails/passwordchanged.html index 6d4330860..42edd6f92 100644 --- a/emails/passwordchanged.html +++ b/emails/passwordchanged.html @@ -25,6 +25,6 @@ Best Wishes,
-The Quay Team
+The {{ app_title }} Team
{% endblock %} diff --git a/emails/paymentfailure.html b/emails/paymentfailure.html index 395e574a3..64fb3bfcd 100644 --- a/emails/paymentfailure.html +++ b/emails/paymentfailure.html @@ -25,6 +25,6 @@ Thank you,
-The Quay Team
+The {{ app_title }} Team
{% endblock %} diff --git a/emails/recovery.html b/emails/recovery.html index 7c6fe4ccf..cab230521 100644 --- a/emails/recovery.html +++ b/emails/recovery.html @@ -7,7 +7,7 @@ - +
A user at Quay.io (local) has attempted to recover their access to the account registered to this email addressA user at {{ app_title }} has attempted to recover their access to the account registered to this email address
@@ -25,6 +25,6 @@ Best Wishes,
-The Quay Team
+The {{ app_title }} Team
{% endblock %} diff --git a/emails/repoauthorizeemail.html b/emails/repoauthorizeemail.html index 3f7b6e391..a98534f4d 100644 --- a/emails/repoauthorizeemail.html +++ b/emails/repoauthorizeemail.html @@ -25,6 +25,6 @@ Thank you,
-The Quay Team
+The {{ app_title }} Team
{% endblock %} diff --git a/emails/teaminvite.html b/emails/teaminvite.html index ff757f013..0e4f11198 100644 --- a/emails/teaminvite.html +++ b/emails/teaminvite.html @@ -25,6 +25,6 @@ Thank you,
-The Quay Team
+The {{ app_title }} Team
{% endblock %} From c07a87a2b44f36a1c7e39122409f4e86cdb4a3af Mon Sep 17 00:00:00 2001 From: Ben Spoon Date: Mon, 8 Aug 2016 11:04:53 -0700 Subject: [PATCH 09/11] emails: user app_url for user login ref --- emails/base.html | 4 ++-- tools/email-viewer/emails.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/emails/base.html b/emails/base.html index 41e3f7bd6..08c43e79d 100644 --- a/emails/base.html +++ b/emails/base.html @@ -61,9 +61,9 @@ - + - +
Your AccountYour Account DocumentationQuay.ioQuay.io
{% endif %} diff --git a/tools/email-viewer/emails.py b/tools/email-viewer/emails.py index 996970b48..609548761 100644 --- a/tools/email-viewer/emails.py +++ b/tools/email-viewer/emails.py @@ -39,7 +39,7 @@ def render_with_options(template=None): 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", - hosted = "Quay" in app_title, app_title = app_title) + hosted = "Quay" in app_title, app_title = app_title, app_url="https://quay.io") def get_templates(): """ Return a list of the available templates """ From 2b92fded685ff69704ff567b58a1987275bebdbb Mon Sep 17 00:00:00 2001 From: Ben Spoon Date: Mon, 8 Aug 2016 13:29:47 -0700 Subject: [PATCH 10/11] emails: address review feedback --- emails/changeemail.html | 4 ++-- tools/email-viewer/emails.py | 2 +- util/useremails.py | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/emails/changeemail.html b/emails/changeemail.html index 663b2f8ef..ee239f3fb 100644 --- a/emails/changeemail.html +++ b/emails/changeemail.html @@ -4,7 +4,7 @@

E-mail Address Change Requested


-This email address was added to the {{ app_title }} account {{username}}. +This email address was added to the {{ app_title }} account {{ username }}. @@ -13,7 +13,7 @@
- +
If you did not add this address to {{username}}, you can safely ignore this message.If you did not add this address to {{ username }}, you can safely ignore this message.
Best Regards, diff --git a/tools/email-viewer/emails.py b/tools/email-viewer/emails.py index 609548761..bc78b3df4 100644 --- a/tools/email-viewer/emails.py +++ b/tools/email-viewer/emails.py @@ -39,7 +39,7 @@ def render_with_options(template=None): 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", - hosted = "Quay" in app_title, app_title = app_title, app_url="https://quay.io") + hosted = False, app_title = app_title, app_url="https://quay.io") def get_templates(): """ Return a list of the available templates """ diff --git a/util/useremails.py b/util/useremails.py index 44efa9568..26235b1ee 100644 --- a/util/useremails.py +++ b/util/useremails.py @@ -1,6 +1,7 @@ import logging import traceback import json +import features from flask.ext.mail import Message @@ -54,14 +55,14 @@ def send_email(recipient, subject, template_file, parameters, action=None): app_url = get_app_url() def app_link_handler(url=None): - return real_url = app_url + '/' + url if url else app_url + 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': 'Quay' in app_title, + 'hosted': features.BILLING, 'app_link': app_link_handler, 'action_metadata': json.dumps(action.metadata) if action else None }) From c3c05ec2255edc3da99a926a2cd6522c914ff17a Mon Sep 17 00:00:00 2001 From: Ben Spoon Date: Mon, 8 Aug 2016 15:43:16 -0700 Subject: [PATCH 11/11] emails: python formatting change --- tools/email-viewer/emails.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/email-viewer/emails.py b/tools/email-viewer/emails.py index bc78b3df4..b8efe0c2a 100644 --- a/tools/email-viewer/emails.py +++ b/tools/email-viewer/emails.py @@ -39,7 +39,7 @@ def render_with_options(template=None): 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", - hosted = False, app_title = app_title, app_url="https://quay.io") + hosted=False, app_title=app_title, app_url="https://quay.io") def get_templates(): """ Return a list of the available templates """