Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
sponsorship: Ask user how they plan to use Zulip.
Aman Agrawalb549562a4d78
diff --git a/corporate/lib/stripe.py b/corporate/lib/stripe.pyindex b2e3df8c19c..30019a884e6 100644--- a/corporate/lib/stripe.py+++ b/corporate/lib/stripe.py@@ -696,6 +696,7 @@ class SponsorshipRequestForm(forms.Form):organization_type = forms.IntegerField()description = forms.CharField(widget=forms.Textarea)expected_total_users = forms.CharField(widget=forms.Textarea)+ plan_to_use_zulip = forms.CharField(widget=forms.Textarea)paid_users_count = forms.CharField(widget=forms.Textarea)paid_users_description = forms.CharField(widget=forms.Textarea, required=False)requested_plan = forms.ChoiceField(@@ -3498,6 +3499,7 @@ class BillingSession(ABC):org_description=form.cleaned_data["description"],org_type=form.cleaned_data["organization_type"],expected_total_users=form.cleaned_data["expected_total_users"],+ plan_to_use_zulip=form.cleaned_data["plan_to_use_zulip"],paid_users_count=form.cleaned_data["paid_users_count"],paid_users_description=form.cleaned_data["paid_users_description"],requested_plan=form.cleaned_data["requested_plan"],@@ -3526,6 +3528,7 @@ class BillingSession(ABC):"website": sponsorship_request.org_website,"description": sponsorship_request.org_description,"expected_total_users": sponsorship_request.expected_total_users,+ "plan_to_use_zulip": sponsorship_request.plan_to_use_zulip,"paid_users_count": sponsorship_request.paid_users_count,"paid_users_description": sponsorship_request.paid_users_description,"requested_plan": sponsorship_request.requested_plan,diff --git a/corporate/lib/support.py b/corporate/lib/support.pyindex e6c214e8311..16984a89702 100644--- a/corporate/lib/support.py+++ b/corporate/lib/support.py@@ -50,6 +50,7 @@ class SponsorshipRequestDict(TypedDict):org_type: strorg_website: strorg_description: str+ plan_to_use_zulip: strtotal_users: strpaid_users: strpaid_users_description: str@@ -185,6 +186,7 @@ def get_customer_sponsorship_data(customer: Customer) -> SponsorshipData:org_website=website,org_description=last_sponsorship_request.org_description,total_users=last_sponsorship_request.expected_total_users,+ plan_to_use_zulip=last_sponsorship_request.plan_to_use_zulip,paid_users=last_sponsorship_request.paid_users_count,paid_users_description=last_sponsorship_request.paid_users_description,requested_plan=last_sponsorship_request.requested_plan,diff --git a/corporate/migrations/0045_zulipsponsorshiprequest_plan_to_use_zulip.py b/corporate/migrations/0045_zulipsponsorshiprequest_plan_to_use_zulip.pynew file mode 100644index 00000000000..faa07832117--- /dev/null+++ b/corporate/migrations/0045_zulipsponsorshiprequest_plan_to_use_zulip.py@@ -0,0 +1,17 @@+# Generated by Django 5.0.10 on 2025-01-14 17:16++from django.db import migrations, models+++class Migration(migrations.Migration):+ dependencies = [+ ("corporate", "0001_squashed_0044_convert_ids_to_bigints"),+ ]++ operations = [+ migrations.AddField(+ model_name="zulipsponsorshiprequest",+ name="plan_to_use_zulip",+ field=models.TextField(default=""),+ ),+ ]diff --git a/corporate/models.py b/corporate/models.pyindex 69eb4b4ad50..22f7b9e9aec 100644--- a/corporate/models.py+++ b/corporate/models.py@@ -576,6 +576,7 @@ class ZulipSponsorshipRequest(models.Model):org_description = models.TextField(default="")expected_total_users = models.TextField(default="")+ plan_to_use_zulip = models.TextField(default="")paid_users_count = models.TextField(default="")paid_users_description = models.TextField(default="")diff --git a/corporate/tests/test_stripe.py b/corporate/tests/test_stripe.pyindex d9edb76a788..6ef6c1027d8 100644--- a/corporate/tests/test_stripe.py+++ b/corporate/tests/test_stripe.py@@ -2456,6 +2456,7 @@ class StripeTest(StripeTestCase):"website": "invalid-url","description": "Infinispan is a distributed in-memory key/value data store with optional schema.","expected_total_users": "10 users",+ "plan_to_use_zulip": "For communication on moon.","paid_users_count": "1 user","paid_users_description": "We have 1 paid user.",}@@ -2472,6 +2473,7 @@ class StripeTest(StripeTestCase):"website": "","description": "Infinispan is a distributed in-memory key/value data store with optional schema.","expected_total_users": "10 users",+ "plan_to_use_zulip": "For communication on moon.","paid_users_count": "1 user","paid_users_description": "We have 1 paid user.",}@@ -2570,6 +2572,7 @@ class StripeTest(StripeTestCase):"website": "https://infinispan.org/","description": "Infinispan is a distributed in-memory key/value data store with optional schema.","expected_total_users": "10 users",+ "plan_to_use_zulip": "For communication on moon.","paid_users_count": "1 user","paid_users_description": "We have 1 paid user.",}@@ -8299,6 +8302,7 @@ class TestRemoteRealmBillingFlow(StripeTestCase, RemoteRealmBillingTestCase):"website": "https://infinispan.org/","description": "Infinispan is a distributed in-memory key/value data store with optional schema.","expected_total_users": "10 users",+ "plan_to_use_zulip": "For communication on moon.","paid_users_count": "1 user","paid_users_description": "We have 1 paid user.","requested_plan": "Community",@@ -8926,6 +8930,7 @@ class TestRemoteServerBillingFlow(StripeTestCase, RemoteServerTestCase):"website": "https://infinispan.org/","description": "Infinispan is a distributed in-memory key/value data store with optional schema.","expected_total_users": "10 users",+ "plan_to_use_zulip": "For communication on moon.","paid_users_count": "1 user","paid_users_description": "We have 1 paid user.","requested_plan": "Community",diff --git a/corporate/tests/test_support_views.py b/corporate/tests/test_support_views.pyindex c9c46a7679b..09461e5aefe 100644--- a/corporate/tests/test_support_views.py+++ b/corporate/tests/test_support_views.py@@ -65,6 +65,7 @@ class TestRemoteServerSupportEndpoint(ZulipTestCase):org_website=website,org_description="We help people.",expected_total_users="20-35",+ plan_to_use_zulip="For communication on moon.",paid_users_count=paid_users,paid_users_description="",requested_plan=plan,diff --git a/templates/corporate/billing/sponsorship.html b/templates/corporate/billing/sponsorship.htmlindex f04f1c9515d..97d01cc067e 100644--- a/templates/corporate/billing/sponsorship.html+++ b/templates/corporate/billing/sponsorship.html@@ -150,6 +150,12 @@<textarea id="description" name="description" cols="100" rows="5"></textarea><div id="sponsorship-description-error" class="alert alert-danger sponsorship-field-error"></div></div>+ <div class="input-box sponsorship-form-field">+ <label for="plan-to-use-zulip" class="inline-block+ label-title">How do you plan to use Zulip?</label>+ <textarea id="plan-to-use-zulip" name="plan_to_use_zulip" cols="100" rows="2"></textarea>+ <div id="sponsorship-plan-to-use-zulip-error" class="alert alert-danger sponsorship-field-error"></div>+ </div><div class="input-box sponsorship-form-field"><label for="expected-total-users" class="inline-block label-title">Expected number of users (approximate range)</label><input id="expected-total-users" name="expected_total_users" type="text" />diff --git a/templates/zerver/emails/sponsorship_request.html b/templates/zerver/emails/sponsorship_request.htmlindex b9ceeac2151..f1b96942bd9 100644--- a/templates/zerver/emails/sponsorship_request.html+++ b/templates/zerver/emails/sponsorship_request.html@@ -29,6 +29,12 @@<br /><br />+<b>How do you plan to use Zulip?</b>+<br />+{{ plan_to_use_zulip }}++<br /><br />+<b>Expected users</b>: {{ expected_total_users }}<br /><br />diff --git a/templates/zerver/emails/sponsorship_request.txt b/templates/zerver/emails/sponsorship_request.txtindex 480a5880d05..8cdb14bafe7 100644--- a/templates/zerver/emails/sponsorship_request.txt+++ b/templates/zerver/emails/sponsorship_request.txt@@ -7,6 +7,9 @@ Organization type: {{ organization_type }}Description:{{ description }}+How do you plan to use Zulip?+{{ plan_to_use_zulip }}+Expected users:- Total: {{ expected_total_users }}- Paid: {{ paid_users_count }}diff --git a/web/src/billing/sponsorship.ts b/web/src/billing/sponsorship.tsindex 16f4c3f459e..b458836a8c5 100644--- a/web/src/billing/sponsorship.ts+++ b/web/src/billing/sponsorship.ts@@ -44,6 +44,15 @@ function validate_data(data: helpers.FormDataObject): boolean {hide_submit_loading_indicator();found_error = true;}++ assert(data.plan_to_use_zulip !== undefined);+ if (data.plan_to_use_zulip.trim() === "") {+ $("#sponsorship-plan-to-use-zulip-error").text(+ "Description of how you plan to use Zulip cannot be blank.",+ );+ hide_submit_loading_indicator();+ found_error = true;+ }return !found_error;}