2022-06-29 11:28:26 +02:00
|
|
|
{% extends "dashboard/domain_detail/base.html" %}
|
2019-12-30 17:52:08 +01:00
|
|
|
|
|
|
|
{% set domain_detail_page = "info" %}
|
2022-06-29 11:28:26 +02:00
|
|
|
{% block title %}{{ custom_domain.domain }} Info{% endblock %}
|
2019-12-30 17:52:08 +01:00
|
|
|
{% block domain_detail_content %}
|
|
|
|
|
2022-06-29 11:28:26 +02:00
|
|
|
<h1 class="h2 mb-1">{{ custom_domain.domain }}</h1>
|
2021-09-17 11:38:07 +02:00
|
|
|
<div class="small-text">Created {{ custom_domain.created_at | dt }}. {{ nb_alias }} aliases</div>
|
2022-06-29 11:28:26 +02:00
|
|
|
<hr />
|
|
|
|
<h3 class="mb-1">Auto create/on the fly alias</h3>
|
2019-12-30 18:20:49 +01:00
|
|
|
<div>
|
|
|
|
<form method="post">
|
2022-10-27 10:04:47 +02:00
|
|
|
{{ csrf_form.csrf_token }}
|
2019-12-30 18:20:49 +01:00
|
|
|
<input type="hidden" name="form-name" value="switch-catch-all">
|
2022-06-29 11:28:26 +02:00
|
|
|
<label class="custom-switch cursor mt-2 pl-0" data-toggle="tooltip" {% if custom_domain.catch_all %}
|
|
|
|
title="Disable catch-all" {% else %} title="Enable catch-all" {% endif %}>
|
|
|
|
<input type="checkbox" class="custom-switch-input" {{ "checked" if custom_domain.catch_all else "" }}>
|
2019-12-30 18:20:49 +01:00
|
|
|
<span class="custom-switch-indicator"></span>
|
2021-09-17 17:41:36 +02:00
|
|
|
<spam class="ml-2">
|
2022-06-29 11:28:26 +02:00
|
|
|
Catch All
|
2021-09-17 17:41:36 +02:00
|
|
|
</spam>
|
2019-12-30 18:20:49 +01:00
|
|
|
</label>
|
|
|
|
</form>
|
2022-06-29 11:28:26 +02:00
|
|
|
<div>
|
2021-09-17 17:41:36 +02:00
|
|
|
Simply use <b>anything@{{ custom_domain.domain }}</b>
|
|
|
|
next time you need an alias: it'll be <b>automatically</b>
|
|
|
|
created the first time it receives an email.
|
2021-09-20 18:28:43 +02:00
|
|
|
To have more fine-grained control, you can also define
|
2022-06-29 11:28:26 +02:00
|
|
|
<a href="{{ url_for('dashboard.domain_detail_auto_create', custom_domain_id=custom_domain.id) }}">
|
|
|
|
auto create
|
2021-09-20 18:28:43 +02:00
|
|
|
rules
|
2022-06-29 11:28:26 +02:00
|
|
|
<i class="fe fe-chevrons-right"></i>
|
|
|
|
</a>
|
|
|
|
.
|
2021-09-17 17:41:36 +02:00
|
|
|
</div>
|
2019-12-30 18:20:49 +01:00
|
|
|
</div>
|
2022-06-29 11:28:26 +02:00
|
|
|
<div class="{% if not custom_domain.catch_all %} disabled-content{% endif %}">
|
|
|
|
<div>
|
|
|
|
Auto-created aliases are automatically owned by the following mailboxes
|
|
|
|
<i class="fe fe-corner-right-down"></i>
|
|
|
|
.
|
2021-09-20 18:28:43 +02:00
|
|
|
</div>
|
2021-09-17 11:54:37 +02:00
|
|
|
{% set domain_mailboxes=custom_domain.mailboxes %}
|
|
|
|
<form method="post" class="mt-2">
|
2022-10-27 10:04:47 +02:00
|
|
|
{{ csrf_form.csrf_token }}
|
2021-09-17 11:54:37 +02:00
|
|
|
<input type="hidden" name="form-name" value="update">
|
|
|
|
<input type="hidden" name="domain-id" value="{{ custom_domain.id }}">
|
|
|
|
<div class="d-flex">
|
|
|
|
<div class="flex-grow-1 mr-2">
|
2022-06-29 11:28:26 +02:00
|
|
|
<select data-width="100%"
|
|
|
|
required
|
|
|
|
class="mailbox-select"
|
|
|
|
multiple
|
|
|
|
name="mailbox_ids">
|
2021-09-17 11:54:37 +02:00
|
|
|
{% for mailbox in mailboxes %}
|
2022-06-29 11:28:26 +02:00
|
|
|
|
|
|
|
<option value="{{ mailbox.id }}"
|
|
|
|
{% if mailbox in domain_mailboxes %} selected{% endif %}>
|
2021-09-17 11:54:37 +02:00
|
|
|
{{ mailbox.email }}
|
|
|
|
</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<button class="btn btn-outline-primary btn-sm">Update</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
2022-06-29 11:28:26 +02:00
|
|
|
<hr />
|
2021-09-17 11:38:07 +02:00
|
|
|
<h3 class="mb-1">Default Display Name</h3>
|
2022-06-29 11:28:26 +02:00
|
|
|
<div>
|
2021-09-17 11:38:07 +02:00
|
|
|
Default display name for aliases created with <b>{{ custom_domain.domain }}</b>
|
2021-09-17 11:54:37 +02:00
|
|
|
unless overwritten by the alias display name.
|
2020-05-03 16:05:34 +02:00
|
|
|
</div>
|
|
|
|
<div>
|
2021-09-17 11:38:07 +02:00
|
|
|
<form method="post" class="form-inline">
|
2022-10-27 10:04:47 +02:00
|
|
|
{{ csrf_form.csrf_token }}
|
2020-05-03 16:05:34 +02:00
|
|
|
<input type="hidden" name="form-name" value="set-name">
|
|
|
|
<div class="form-group">
|
2021-09-17 11:38:07 +02:00
|
|
|
<input class="form-control mr-2"
|
2020-05-03 16:05:34 +02:00
|
|
|
value="{{ custom_domain.name or "" }}"
|
|
|
|
name="alias-name"
|
2021-09-17 11:38:07 +02:00
|
|
|
placeholder="Alias Display Name">
|
2020-05-03 16:05:34 +02:00
|
|
|
</div>
|
2021-09-17 11:38:07 +02:00
|
|
|
<button class="btn btn-outline-primary" name="action" value="save">Save</button>
|
2020-11-24 12:02:47 +01:00
|
|
|
{% if custom_domain.name %}
|
2022-06-29 11:28:26 +02:00
|
|
|
|
|
|
|
<button class="btn btn-outline-danger float-right ml-2"
|
|
|
|
name="action"
|
|
|
|
value="remove">Remove</button>
|
2020-11-24 12:02:47 +01:00
|
|
|
{% endif %}
|
2020-05-03 16:05:34 +02:00
|
|
|
</form>
|
|
|
|
</div>
|
2022-06-29 11:28:26 +02:00
|
|
|
<hr />
|
2021-09-17 11:38:07 +02:00
|
|
|
<h3 class="mb-1">Random Prefix Generation</h3>
|
2022-06-29 11:28:26 +02:00
|
|
|
<div>Add a random prefix for this domain when creating a new alias.</div>
|
2020-10-09 22:54:13 +02:00
|
|
|
<div>
|
|
|
|
<form method="post">
|
2022-10-27 10:04:47 +02:00
|
|
|
{{ csrf_form.csrf_token }}
|
2022-06-29 11:28:26 +02:00
|
|
|
<input type="hidden"
|
|
|
|
name="form-name"
|
|
|
|
value="switch-random-prefix-generation">
|
|
|
|
<label class="custom-switch cursor mt-2 pl-0" data-toggle="tooltip" {% if custom_domain.random_prefix_generation %}
|
|
|
|
title="Disable random prefix generation" {% else %} title="Enable random prefix generation" {% endif %}>
|
|
|
|
<input type="checkbox" class="custom-switch-input" {{ "checked" if custom_domain.random_prefix_generation else "" }}>
|
2020-10-09 22:54:13 +02:00
|
|
|
<span class="custom-switch-indicator"></span>
|
|
|
|
</label>
|
|
|
|
</form>
|
|
|
|
</div>
|
2022-06-29 11:28:26 +02:00
|
|
|
<hr />
|
2021-11-18 10:33:15 +01:00
|
|
|
<h3 class="mb-1">
|
|
|
|
{% if custom_domain.is_sl_subdomain %}
|
2022-06-29 11:28:26 +02:00
|
|
|
|
2021-11-18 10:33:15 +01:00
|
|
|
Delete Subdomain
|
|
|
|
{% else %}
|
|
|
|
Delete Domain
|
|
|
|
{% endif %}
|
|
|
|
</h3>
|
2021-11-20 20:01:36 +01:00
|
|
|
<div class="mb-3">
|
2021-11-18 10:33:15 +01:00
|
|
|
{% if custom_domain.is_sl_subdomain %}
|
2022-06-29 11:28:26 +02:00
|
|
|
|
2021-11-20 20:01:36 +01:00
|
|
|
<div class="alert alert-danger">
|
|
|
|
This operation is <b>irreversible</b>.
|
|
|
|
All aliases associated with this subdomain will be deleted.
|
|
|
|
</div>
|
|
|
|
<div class="alert alert-warning">
|
|
|
|
Because a deleted subdomain can't be recycled, i.e. reused by someone else,
|
|
|
|
deleting a subdomain won't restore the subdomain quota.
|
|
|
|
After deletion, your subdomain quota will still be {{ current_user.subdomain_quota }}.
|
|
|
|
We recommend to disable the <b>catch-all</b> option instead of deleting this subdomain.
|
|
|
|
</div>
|
|
|
|
{% else %}
|
|
|
|
<div class="alert alert-danger">
|
|
|
|
This operation is <b>irreversible</b>.
|
|
|
|
All aliases associated with this domain will be deleted.
|
|
|
|
</div>
|
2021-11-18 10:33:15 +01:00
|
|
|
{% endif %}
|
2019-12-30 18:51:55 +01:00
|
|
|
</div>
|
|
|
|
<form method="post">
|
2022-10-27 10:04:47 +02:00
|
|
|
{{ csrf_form.csrf_token }}
|
2019-12-30 18:51:55 +01:00
|
|
|
<input type="hidden" name="form-name" value="delete">
|
2022-06-29 11:28:26 +02:00
|
|
|
<span class="delete-custom-domain btn btn-danger">Delete {{ custom_domain.domain }}</span>
|
2019-12-30 18:51:55 +01:00
|
|
|
</form>
|
2019-12-30 17:52:08 +01:00
|
|
|
{% endblock %}
|
2019-12-30 18:20:49 +01:00
|
|
|
{% block script %}
|
2022-06-29 11:28:26 +02:00
|
|
|
|
2019-12-30 18:20:49 +01:00
|
|
|
<script>
|
2021-09-17 11:54:37 +02:00
|
|
|
$('.mailbox-select').multipleSelect();
|
|
|
|
|
2019-12-30 18:20:49 +01:00
|
|
|
$(".custom-switch-input").change(function (e) {
|
|
|
|
$(this).closest("form").submit();
|
2019-12-30 18:51:55 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
$(".delete-custom-domain").on("click", function (e) {
|
2020-04-30 22:37:39 +02:00
|
|
|
let that = $(this);
|
|
|
|
|
|
|
|
bootbox.confirm({
|
2022-06-29 11:28:26 +02:00
|
|
|
message: "All aliases associated with <b>{{ custom_domain.domain }}</b> will be also deleted. <br />" +
|
2020-11-12 17:41:47 +01:00
|
|
|
"This operation is not reversible, please confirm.",
|
2020-04-30 22:37:39 +02:00
|
|
|
buttons: {
|
|
|
|
confirm: {
|
|
|
|
label: 'Yes, delete it',
|
|
|
|
className: 'btn-danger'
|
|
|
|
},
|
|
|
|
cancel: {
|
|
|
|
label: 'Cancel',
|
|
|
|
className: 'btn-outline-primary'
|
|
|
|
}
|
2019-12-30 18:51:55 +01:00
|
|
|
},
|
2020-04-30 22:37:39 +02:00
|
|
|
callback: function (result) {
|
|
|
|
if (result) {
|
|
|
|
that.closest("form").submit();
|
|
|
|
}
|
2019-12-30 18:51:55 +01:00
|
|
|
}
|
2020-04-30 22:37:39 +02:00
|
|
|
})
|
2019-12-30 18:51:55 +01:00
|
|
|
});
|
2019-12-30 18:20:49 +01:00
|
|
|
</script>
|
2020-10-09 22:54:13 +02:00
|
|
|
{% endblock %}
|