{% extends 'admin/master.html' %}
{% macro show_user(user) -%}
User {{ user.email }} with ID {{ user.id }}.
{% set pu = helper.partner_user(user) %}
User ID |
Email |
Status |
Paid |
Subscription |
Created At |
Updated At |
Connected with Proton account |
{{ user.id }} |
{{ user.email }} |
{% if user.disabled %}
Disabled |
{% else %}
Enabled |
{% endif %}
{{ "yes" if user.is_paid() else "No" }} |
{{ user.get_active_subscription() }} |
{{ user.created_at }} |
{{ user.updated_at }} |
{% if pu %}
{{ pu.partner_email }} |
{% else %}
No |
{% endif %}
{%- endmacro %}
{% macro list_mailboxes(message, mbox_count, mboxes) %}
{{ mbox_count }} {{ message }}.
{% if mbox_count>10 %}Showing only the last 10.{% endif %}
Mailbox ID |
Email |
Verified |
Created At |
{% for mailbox in mboxes %}
{{ mailbox.id }} |
{{ mailbox.email }} |
{{ "Yes" if mailbox.verified else "No" }} |
{{ mailbox.created_at }}
|
{% endfor %}
{% endmacro %}
{% macro list_alias(alias_count, aliases) %}
{{ alias_count }} Aliases found.
{% if alias_count>10 %}Showing only the last 10.{% endif %}
Alias ID
|
Email
|
Enabled
|
Created At
|
{% for alias in aliases %}
{{ alias.id }} |
{{ alias.email }} |
{{ "Yes" if alias.enabled else "No" }} |
{{ alias.created_at }} |
{% endfor %}
{% endmacro %}
{% macro show_deleted_alias(deleted_alias) -%}
Deleted Alias {{ deleted_alias.email }} with ID {{ deleted_alias.id }}.
Deleted Alias ID |
Email |
Deleted At |
Reason |
{{ deleted_alias.id }} |
{{ deleted_alias.email }} |
{{ deleted_alias.created_at }} |
{{ deleted_alias.reason }} |
{%- endmacro %}
{% macro show_domain_deleted_alias(dom_deleted_alias) -%}
Domain Deleted Alias {{ dom_deleted_alias.email }} with ID {{ dom_deleted_alias.id }} for
domain {{ dom_deleted_alias.domain.domain }}
Deleted Alias ID |
Email |
Domain |
Domain ID |
Domain owner user ID |
Domain owner user email |
Deleted At |
{{ dom_deleted_alias.id }} |
{{ dom_deleted_alias.email }} |
{{ dom_deleted_alias.domain.domain }} |
{{ dom_deleted_alias.domain.id }} |
{{ dom_deleted_alias.domain.user_id }} |
{{ dom_deleted_alias.created_at }} |
{{ show_user(data.domain_deleted_alias.domain.user) }}
{%- endmacro %}
{% block body %}
{% if data.no_match and email %}
No user, alias or mailbox found for {{ email }}
{% endif %}
{% if data.alias %}
Found Alias {{ data.alias.email }}
{{ list_alias(1,[data.alias]) }}
{{ list_mailboxes("Mailboxes for alias", helper.alias_mailbox_count(data.alias), helper.alias_mailboxes(data.alias)) }}
{{ show_user(data.alias.user) }}
{% endif %}
{% if data.user %}
Found User {{ data.user.email }}
{{ show_user(data.user) }}
{{ list_mailboxes("Mailboxes for user", helper.mailbox_count(data.user) , helper.mailbox_list(data.user) ) }}
{{ list_alias(helper.alias_count(data.user) ,helper.alias_list(data.user)) }}
{% endif %}
{% if data.mailbox_count > 10 %}
Found more than 10 mailboxes for {{ email }}. Showing the last 10
{% elif data.mailbox_count > 0 %}
Found {{ data.mailbox_count }} mailbox(es) for {{ email }}
{% endif %}
{% for mailbox in data.mailbox %}
Found Mailbox {{ mailbox.email }}
{{ list_mailboxes("Mailbox found", 1, [mailbox]) }}
{{ show_user(mailbox.user) }}
{% endfor %}
{% if data.deleted_alias %}
Found DeletedAlias {{ data.deleted_alias.email }}
{{ show_deleted_alias(data.deleted_alias) }}
{% endif %}
{% if data.domain_deleted_alias %}
Found DomainDeletedAlias {{ data.domain_deleted_alias.email }}
{{ show_domain_deleted_alias(data.domain_deleted_alias) }}
{% endif %}
{% endblock %}