From 421547f6acc89fd5b62482b99d337eddcc3b106d Mon Sep 17 00:00:00 2001 From: sujal Date: Fri, 15 Mar 2024 01:06:34 +0530 Subject: [PATCH] emails: Add onboarding_zulip_guide_url to the "unspecified" org_types. Update the onboarding_zulip_guide email functionality to handle cases where there is no dedicated marketing page for the organization's type or when the type is unspecified. In such cases, the email now includes an introduction text inviting users to explore Zulip features and provides a link to https://zulip.com/use-cases/. fixes #26868. --- .../zerver/emails/onboarding_zulip_guide.html | 16 +++++++++++++++- .../emails/onboarding_zulip_guide.subject.txt | 10 ++++++++++ .../zerver/emails/onboarding_zulip_guide.txt | 10 ++++++++++ zerver/models/realms.py | 10 +++++----- 4 files changed, 40 insertions(+), 6 deletions(-) diff --git a/templates/zerver/emails/onboarding_zulip_guide.html b/templates/zerver/emails/onboarding_zulip_guide.html index 00d81175ab..de3ba5b97c 100644 --- a/templates/zerver/emails/onboarding_zulip_guide.html +++ b/templates/zerver/emails/onboarding_zulip_guide.html @@ -6,7 +6,11 @@ {% block content %} -

{{ _("As you are getting started with Zulip, we'd love to help you discover how it can work best for your needs. Check out this guide to key Zulip features for organizations like yours!") }}

+{% if organization_type in ["government", "political_group", "personal", "other"] %} +

{{ _("As you are getting started with Zulip, we'd love to help you discover how it can work best for your needs. Check out our guides to key Zulip features!") }}

+{% else %} +

{{ _("As you are getting started with Zulip, we'd love to help you discover how it can work best for your needs. Check out this guide to key Zulip features.") }}

+{% endif %} {% if organization_type == "business" %} @@ -23,6 +27,16 @@ {{ _("View Zulip guide for non-profits") }} {% elif organization_type == "community" %} {{ _("View Zulip guide for communities") }} +{% elif organization_type == "unspecified" %} +{{ _("View Zulip guide") }} +{% elif organization_type == "government" %} +{{ _("View Zulip guide") }} +{% elif organization_type == "political_group" %} +{{ _("View Zulip guide") }} +{% elif organization_type == "personal" %} +{{ _("View Zulip guide") }} +{% elif organization_type == "other" %} +{{ _("View Zulip guide") }} {% endif %}

diff --git a/templates/zerver/emails/onboarding_zulip_guide.subject.txt b/templates/zerver/emails/onboarding_zulip_guide.subject.txt index 2e88fb21c8..5227ac4583 100644 --- a/templates/zerver/emails/onboarding_zulip_guide.subject.txt +++ b/templates/zerver/emails/onboarding_zulip_guide.subject.txt @@ -12,4 +12,14 @@ {{ _("Zulip guide for non-profits") }} {% elif organization_type == "community" %} {{ _("Zulip guide for communities") }} +{% elif organization_type == "unspecified" %} +{{ _("Zulip guide") }} +{% elif organization_type == "government" %} +{{ _("Zulip guide") }} +{% elif organization_type == "political_group" %} +{{ _("Zulip guide") }} +{% elif organization_type == "personal" %} +{{ _("Zulip guide") }} +{% elif organization_type == "other" %} +{{ _("Zulip guide") }} {% endif %} diff --git a/templates/zerver/emails/onboarding_zulip_guide.txt b/templates/zerver/emails/onboarding_zulip_guide.txt index 446f38bc34..fd9a13717e 100644 --- a/templates/zerver/emails/onboarding_zulip_guide.txt +++ b/templates/zerver/emails/onboarding_zulip_guide.txt @@ -14,6 +14,16 @@ {{ _("View Zulip guide for non-profits") }}: {% elif organization_type == "community" %} {{ _("View Zulip guide for communities") }}: +{% elif organization_type == "unspecified" %} +{{ _("View Zulip guide") }}: +{% elif organization_type == "government" %} +{{ _("View Zulip guide") }}: +{% elif organization_type == "political_group" %} +{{ _("View Zulip guide") }}: +{% elif organization_type == "personal" %} +{{ _("View Zulip guide") }}: +{% elif organization_type == "other" %} +{{ _("View Zulip guide") }}: {% endif %} <{{ zulip_guide_link }}> diff --git a/zerver/models/realms.py b/zerver/models/realms.py index 1339958007..e3881a4210 100644 --- a/zerver/models/realms.py +++ b/zerver/models/realms.py @@ -379,7 +379,7 @@ class Realm(models.Model): # type: ignore[django-manager-missing] # django-stub "id": OrgTypeEnum.Unspecified.value, "hidden": True, "display_order": 0, - "onboarding_zulip_guide_url": None, + "onboarding_zulip_guide_url": "https://zulip.com/use-cases/", }, "business": { "name": "Business", @@ -435,14 +435,14 @@ class Realm(models.Model): # type: ignore[django-manager-missing] # django-stub "id": OrgTypeEnum.Government.value, "hidden": False, "display_order": 8, - "onboarding_zulip_guide_url": None, + "onboarding_zulip_guide_url": "https://zulip.com/use-cases/", }, "political_group": { "name": "Political group", "id": OrgTypeEnum.PoliticalGroup.value, "hidden": False, "display_order": 9, - "onboarding_zulip_guide_url": None, + "onboarding_zulip_guide_url": "https://zulip.com/use-cases/", }, "community": { "name": "Community", @@ -456,14 +456,14 @@ class Realm(models.Model): # type: ignore[django-manager-missing] # django-stub "id": OrgTypeEnum.Personal.value, "hidden": False, "display_order": 100, - "onboarding_zulip_guide_url": None, + "onboarding_zulip_guide_url": "https://zulip.com/use-cases/", }, "other": { "name": "Other", "id": OrgTypeEnum.Other.value, "hidden": False, "display_order": 1000, - "onboarding_zulip_guide_url": None, + "onboarding_zulip_guide_url": "https://zulip.com/use-cases/", }, }