{% extends 'admin/master.html' %} {% macro show_user(user) -%}

User {{ user.email }} with ID {{ user.id }}.

{% set pu = helper.partner_user(user) %} {% if user.disabled %} {% else %} {% endif %} {% if pu %} {% else %} {% endif %}
User ID Email Status Paid Subscription Created At Updated At Connected with Proton account
{{ user.id }} {{ user.email }}DisabledEnabled{{ "yes" if user.is_paid() else "No" }} {{ user.get_active_subscription() }} {{ user.created_at }} {{ user.updated_at }}{{ pu.partner_email }}No
{%- endmacro %} {% macro list_mailboxes(message, mbox_count, mboxes) %}

{{ mbox_count }} {{ message }}. {% if mbox_count>10 %}Showing only the last 10.{% endif %}

{% for mailbox in mboxes %} {% endfor %}
Mailbox ID Email Verified Created At
{{ mailbox.id }} {{ mailbox.email }} {{ "Yes" if mailbox.verified else "No" }} {{ mailbox.created_at }}
{% endmacro %} {% macro list_alias(alias_count, aliases) %}

{{ alias_count }} Aliases found. {% if alias_count>10 %}Showing only the last 10.{% endif %}

{% for alias in aliases %} {% endfor %}
Alias ID Email Verified Created At
{{ alias.id }} {{ alias.email }} {{ "Yes" if alias.verified else "No" }} {{ alias.created_at }}
{% 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 %} {% 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 %}