Skip to content

Email verification feedback #4534

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tests/common/db/accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ class Meta:
email = FuzzyEmail()
verified = True
primary = True
unverify_reason = None
transient_bounces = 0
31 changes: 26 additions & 5 deletions warehouse/templates/manage/account.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,31 @@
{% endif %}
{% endmacro %}

{% macro email_verification_label(email) -%}
{% if email.verified %}
{% if email.transient_bounces %}
{% set message = "Intermittent delivery problems may lead to verification loss" %}
<span class="badge badge--warning tooltipped tooltipped-s" data-original-label="{{ message }}" aria-label="{{ message }}"><i class="fa fa-exclamation-triangle"></i> Verified</span>
{% else %}
<span class="badge badge--success"><i class="fa fa-check"></i> Verified</span>
{% endif %}
{% else %}
{% set icon = 'exclamation-triangle' %}
{% if email.unverify_reason.value == "spam complaint" %}
{% set message = "Email from PyPI being treated as spam" %}
{% set icon = 'ban' %}
{% elif email.unverify_reason.value == "hard bounce" %}
{% set message = "Hard failure during delivery" %}
{% elif email.unverify_reason.value == "soft bounce" %}
{% set message = "Too many delivery problems" %}
{% else %}
{% set message = "Verification in progress" %}
{% set icon = 'spinner' %}
{% endif %}
<span class="badge badge--danger tooltipped tooltipped-s" aria-label="{{ message }}" data-original-label="{{ message }}"><i class="fa fa-{{ icon }}"></i> Unverified</span>
{% endif %}
{% endmacro %}

{% macro email_row(email) -%}
<tr>
<td class="table__email">
Expand All @@ -57,11 +82,7 @@
{% if email.primary %}
<span class="badge">Primary</span>
{% endif %}
{% if email.verified %}
<span class="badge badge--success">Verified</span>
{% else %}
<span class="badge badge--danger">Unverified</span>
{% endif %}
{{ email_verification_label(email) }}
</div>
</td>
<td class="table__action">
Expand Down