Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

realm-deactivation: Add demo organization to email context.

Lauryn Menardae5ff30fe783
diff --git a/templates/zerver/emails/realm_deactivated.html b/templates/zerver/emails/realm_deactivated.html
index dd46e12c219..e9c2a3e73b8 100644
--- a/templates/zerver/emails/realm_deactivated.html
+++ b/templates/zerver/emails/realm_deactivated.html
@@ -10,12 +10,22 @@
{% block content %}
<p>
- {% if acting_user and initiated_deactivation %}
- {% trans %}You have deactivated your Zulip organization, {{ realm_name }}, on {{ localized_date }}.{% endtrans %}
- {% elif acting_user %}
- {% trans %}Your Zulip organization, {{ realm_name }}, was deactivated by {{ deactivating_owner }} on {{ localized_date }}.{% endtrans %}
+ {% if is_demo_organization %}
+ {% if acting_user and initiated_deactivation %}
+ {% trans %}You have deactivated your Zulip demo organization, {{ realm_name }}, on {{ localized_date }}.{% endtrans %}
+ {% elif acting_user %}
+ {% trans %}Your Zulip demo organization, {{ realm_name }}, was deactivated by {{ deactivating_owner }} on {{ localized_date }}.{% endtrans %}
+ {% else %}
+ {% trans %}Your Zulip demo organization, {{ realm_name }}, was deactivated on {{ localized_date }}.{% endtrans %}
+ {% endif %}
{% else %}
- {% trans %}Your Zulip organization, {{ realm_name }}, was deactivated on {{ localized_date }}.{% endtrans %}
+ {% if acting_user and initiated_deactivation %}
+ {% trans %}You have deactivated your Zulip organization, {{ realm_name }}, on {{ localized_date }}.{% endtrans %}
+ {% elif acting_user %}
+ {% trans %}Your Zulip organization, {{ realm_name }}, was deactivated by {{ deactivating_owner }} on {{ localized_date }}.{% endtrans %}
+ {% else %}
+ {% trans %}Your Zulip organization, {{ realm_name }}, was deactivated on {{ localized_date }}.{% endtrans %}
+ {% endif %}
{% endif %}
{% if data_already_deleted %}
{% trans %}All data associated with this organization has been permanently deleted.{% endtrans %}
diff --git a/templates/zerver/emails/realm_deactivated.txt b/templates/zerver/emails/realm_deactivated.txt
index baff7d9849f..c0a785caf62 100644
--- a/templates/zerver/emails/realm_deactivated.txt
+++ b/templates/zerver/emails/realm_deactivated.txt
@@ -2,12 +2,22 @@
{% if scheduled_deletion_date %}
{% set deletion_date = scheduled_deletion_date|localize %}
{% endif %}
-{% if acting_user and initiated_deactivation %}
- {% trans %}You have deactivated your Zulip organization, {{ realm_name }}, on {{ localized_date }}. {% endtrans %}
-{% elif acting_user %}
- {% trans %}Your Zulip organization, {{ realm_name }}, was deactivated by {{ deactivating_owner }} on {{ localized_date }}. {% endtrans %}
+{% if is_demo_organization %}
+ {% if acting_user and initiated_deactivation %}
+ {% trans %}You have deactivated your Zulip demo organization, {{ realm_name }}, on {{ localized_date }}.{% endtrans %}
+ {% elif acting_user %}
+ {% trans %}Your Zulip demo organization, {{ realm_name }}, was deactivated by {{ deactivating_owner }} on {{ localized_date }}.{% endtrans %}
+ {% else %}
+ {% trans %}Your Zulip demo organization, {{ realm_name }}, was deactivated on {{ localized_date }}.{% endtrans %}
+ {% endif %}
{% else %}
- {% trans %}Your Zulip organization, {{ realm_name }}, was deactivated on {{ localized_date }}. {% endtrans %}
+ {% if acting_user and initiated_deactivation %}
+ {% trans %}You have deactivated your Zulip organization, {{ realm_name }}, on {{ localized_date }}.{% endtrans %}
+ {% elif acting_user %}
+ {% trans %}Your Zulip organization, {{ realm_name }}, was deactivated by {{ deactivating_owner }} on {{ localized_date }}.{% endtrans %}
+ {% else %}
+ {% trans %}Your Zulip organization, {{ realm_name }}, was deactivated on {{ localized_date }}.{% endtrans %}
+ {% endif %}
{% endif %}
{% if data_already_deleted %}
{% trans %}All data associated with this organization has been permanently deleted.{% endtrans %}
diff --git a/zerver/actions/realm_settings.py b/zerver/actions/realm_settings.py
index 8eb8297586d..a91dcb70067 100644
--- a/zerver/actions/realm_settings.py
+++ b/zerver/actions/realm_settings.py
@@ -961,6 +961,7 @@ def do_send_realm_deactivation_email(
) -> None:
shared_context: dict[str, Any] = {
"realm_name": realm.name,
+ "is_demo_organization": realm.demo_organization_scheduled_deletion_date is not None,
}
deactivation_time = timezone_now()
owners = set(realm.get_human_owner_users())