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.

support: Add field to ask type of hosting request in demo form.

Aman Agrawal87694e9606fc
diff --git a/corporate/tests/test_stripe.py b/corporate/tests/test_stripe.py
index 1560ee8dd12..c1ea01c3d20 100644
--- a/corporate/tests/test_stripe.py
+++ b/corporate/tests/test_stripe.py
@@ -2563,6 +2563,7 @@ class StripeTest(StripeTestCase):
"organization_type": "Business",
"organization_website": "https://example.com",
"expected_user_count": "10 (2 unpaid members)",
+ "type_of_hosting": "Zulip Cloud",
"message": "Need help!",
}
result = self.client_post("/request-demo/", data)
@@ -2580,6 +2581,7 @@ class StripeTest(StripeTestCase):
self.assertEqual(self.email_envelope_from(message), settings.NOREPLY_EMAIL_ADDRESS)
self.assertIn("Zulip demo request <noreply-", self.email_display_from(message))
self.assertIn("Full name: King Hamlet", message.body)
+ self.assertIn("Zulip Cloud", message.body)
def test_support_request(self) -> None:
user = self.example_user("hamlet")
diff --git a/corporate/views/support.py b/corporate/views/support.py
index 545545551bf..4cdd25f16d0 100644
--- a/corporate/views/support.py
+++ b/corporate/views/support.py
@@ -87,6 +87,11 @@ class DemoRequestForm(forms.Form):
SORTED_ORG_TYPE_NAMES = sorted(
([org_type["name"] for org_type in Realm.ORG_TYPES.values() if not org_type["hidden"]]),
)
+ TYPE_OF_HOSTING_OPTIONS = [
+ "Zulip Cloud",
+ "Self-hosting",
+ "Both / not sure",
+ ]
full_name = forms.CharField(max_length=MAX_INPUT_LENGTH)
email = forms.EmailField()
role = forms.CharField(max_length=MAX_INPUT_LENGTH)
@@ -94,6 +99,7 @@ class DemoRequestForm(forms.Form):
organization_type = forms.CharField()
organization_website = forms.URLField(required=True, assume_scheme="https")
expected_user_count = forms.CharField(max_length=MAX_INPUT_LENGTH)
+ type_of_hosting = forms.CharField()
message = forms.CharField(widget=forms.Textarea)
@@ -157,6 +163,7 @@ def demo_request(request: HttpRequest) -> HttpResponse:
context = {
"MAX_INPUT_LENGTH": DemoRequestForm.MAX_INPUT_LENGTH,
"SORTED_ORG_TYPE_NAMES": DemoRequestForm.SORTED_ORG_TYPE_NAMES,
+ "TYPE_OF_HOSTING_OPTIONS": DemoRequestForm.TYPE_OF_HOSTING_OPTIONS,
}
if request.POST:
@@ -174,6 +181,7 @@ def demo_request(request: HttpRequest) -> HttpResponse:
"organization_type": form.cleaned_data["organization_type"],
"organization_website": form.cleaned_data["organization_website"],
"expected_user_count": form.cleaned_data["expected_user_count"],
+ "type_of_hosting": form.cleaned_data["type_of_hosting"],
"message": form.cleaned_data["message"],
}
# Sent to the server's sales team, so this email is not user-facing.
diff --git a/templates/corporate/support/demo_request.html b/templates/corporate/support/demo_request.html
index 4ed0a48d960..af8819ac10e 100644
--- a/templates/corporate/support/demo_request.html
+++ b/templates/corporate/support/demo_request.html
@@ -48,6 +48,18 @@
<label for="request_demo_form_expected_user_count" class="inline-block label-title">Expected number of users (approximate range)</label>
<input id="request_demo_form_expected_user_count" class="required" type="text" name="expected_user_count" maxlength="{{ MAX_INPUT_LENGTH }}" required />
</div>
+ <div class="input-box support-form-field">
+ <label for="request_demo_form_type_of_hosting" class="inline-block label-title">Are you interested in Zulip Cloud (SaaS) or self-hosting Zulip?</label>
+ <select id="request_demo_form_type_of_hosting" name="type_of_hosting" class="required">
+ <option value="" disabled selected>Select an option</option>
+ {% for hosting_option in TYPE_OF_HOSTING_OPTIONS %}
+ <option
+ value="{{ hosting_option }}">
+ {{ hosting_option }}
+ </option>
+ {% endfor %}
+ </select>
+ </div>
<div class="input-box support-form-field">
<label for="request_demo_form_message" class="inline-block label-title">How can we help?</label>
<textarea id="request_demo_form_message" name="message" cols="100" rows="5" required></textarea>
diff --git a/templates/zerver/emails/demo_request.html b/templates/zerver/emails/demo_request.html
index 0ecc4890f94..a00ba4026da 100644
--- a/templates/zerver/emails/demo_request.html
+++ b/templates/zerver/emails/demo_request.html
@@ -15,6 +15,8 @@
<br />
<b>Expected user count</b>: {{ expected_user_count }}
<br />
+<b>Cloud or self-hosting?</b>: {{ type_of_hosting }}
+<br />
<b>Message</b>: {{ message }}
<br />
diff --git a/templates/zerver/emails/demo_request.txt b/templates/zerver/emails/demo_request.txt
index 9d26158589c..e31a6913666 100644
--- a/templates/zerver/emails/demo_request.txt
+++ b/templates/zerver/emails/demo_request.txt
@@ -12,4 +12,6 @@ Organization website: {{ organization_website }}
Expected user count: {{ expected_user_count }}
+Cloud or self-hosting?: {{ type_of_hosting }}
+
Message: {{ message }}