diff --git a/corporate/lib/stripe.py b/corporate/lib/stripe.py index 0216709e1b..84195f89f8 100644 --- a/corporate/lib/stripe.py +++ b/corporate/lib/stripe.py @@ -5470,7 +5470,7 @@ def maybe_send_invoice_overdue_email( "billing_entity": billing_session.billing_entity_display_name, "support_url": billing_session.support_url(), "last_audit_log_update": "Never uploaded", - "notice_reason": "invoice_overdue", + "notice_reason": "stale_audit_log_data", } send_email( "zerver/emails/internal_billing_notice", @@ -5492,7 +5492,7 @@ def maybe_send_invoice_overdue_email( "billing_entity": billing_session.billing_entity_display_name, "support_url": billing_session.support_url(), "last_audit_log_update": last_audit_log_update.strftime("%Y-%m-%d"), - "notice_reason": "invoice_overdue", + "notice_reason": "stale_audit_log_data", } send_email( "zerver/emails/internal_billing_notice", diff --git a/corporate/tests/test_stripe.py b/corporate/tests/test_stripe.py index 48c76b7263..1f143a1ce7 100644 --- a/corporate/tests/test_stripe.py +++ b/corporate/tests/test_stripe.py @@ -8734,7 +8734,7 @@ class TestRemoteRealmBillingFlow(StripeTestCase, RemoteRealmBillingTestCase): self.assertEqual(message.to[0], "sales@zulip.com") self.assertEqual( message.subject, - f"Invoice overdue for {self.billing_session.billing_entity_display_name} due to stale data", + f"Stale audit log data for {self.billing_session.billing_entity_display_name}'s plan", ) self.assertIn( f"Support URL: {self.billing_session.support_url()}", @@ -8744,7 +8744,10 @@ class TestRemoteRealmBillingFlow(StripeTestCase, RemoteRealmBillingTestCase): f"Internal billing notice for {self.billing_session.billing_entity_display_name}.", message.body, ) - self.assertIn("Recent invoice is overdue for payment.", message.body) + self.assertIn( + "Unable to verify current licenses in use, which delays invoicing for this customer.", + message.body, + ) self.assertIn( f"Last data upload: {last_audit_log_update.strftime('%Y-%m-%d')}", message.body ) @@ -10272,7 +10275,7 @@ class TestRemoteServerBillingFlow(StripeTestCase, RemoteServerTestCase): self.assertEqual(message.to[0], "sales@zulip.com") self.assertEqual( message.subject, - f"Invoice overdue for {self.billing_session.billing_entity_display_name} due to stale data", + f"Stale audit log data for {self.billing_session.billing_entity_display_name}'s plan", ) self.assertIn( f"Support URL: {self.billing_session.support_url()}", @@ -10282,7 +10285,10 @@ class TestRemoteServerBillingFlow(StripeTestCase, RemoteServerTestCase): f"Internal billing notice for {self.billing_session.billing_entity_display_name}.", message.body, ) - self.assertIn("Recent invoice is overdue for payment.", message.body) + self.assertIn( + "Unable to verify current licenses in use, which delays invoicing for this customer.", + message.body, + ) self.assertIn( f"Last data upload: {last_audit_log_upload.strftime('%Y-%m-%d')}", message.body ) diff --git a/templates/zerver/emails/internal_billing_notice.html b/templates/zerver/emails/internal_billing_notice.html index 2d72ad0e69..00f9010fe4 100644 --- a/templates/zerver/emails/internal_billing_notice.html +++ b/templates/zerver/emails/internal_billing_notice.html @@ -6,8 +6,8 @@ {% if notice_reason == "fixed_price_plan_ends_soon" %}
Reminder to re-evaluate the pricing and configure a new fixed-price plan accordingly.
-{% elif notice_reason == "invoice_overdue" %} -Recent invoice is overdue for payment.
+{% elif notice_reason == "stale_audit_log_data" %} +Unable to verify current licenses in use, which delays invoicing for this customer.
Last data upload: {{ last_audit_log_update }} {% elif notice_reason == "locally_deleted_realm_on_paid_plan" %}Investigate why remote realm is marked as locally deleted when it's on a paid plan.
diff --git a/templates/zerver/emails/internal_billing_notice.subject.txt b/templates/zerver/emails/internal_billing_notice.subject.txt index e7e8864585..636b3fa97c 100644 --- a/templates/zerver/emails/internal_billing_notice.subject.txt +++ b/templates/zerver/emails/internal_billing_notice.subject.txt @@ -1,7 +1,7 @@ {% if notice_reason == "fixed_price_plan_ends_soon" %} Fixed-price plan for {{ billing_entity }} ends on {{ end_date }} -{% elif notice_reason == "invoice_overdue" %} -Invoice overdue for {{ billing_entity }} due to stale data +{% elif notice_reason == "stale_audit_log_data" %} +Stale audit log data for {{ billing_entity }}'s plan {% elif notice_reason == "locally_deleted_realm_on_paid_plan" %} {{ billing_entity }} on paid plan marked as locally deleted {% elif notice_reason == "license_discrepancy" %} diff --git a/templates/zerver/emails/internal_billing_notice.txt b/templates/zerver/emails/internal_billing_notice.txt index 3cdf9b219c..203275c6f9 100644 --- a/templates/zerver/emails/internal_billing_notice.txt +++ b/templates/zerver/emails/internal_billing_notice.txt @@ -2,8 +2,8 @@ Internal billing notice for {{ billing_entity }}. {% if notice_reason == "fixed_price_plan_ends_soon" %} Reminder to re-evaluate the pricing and configure a new fixed-price plan accordingly. -{% elif notice_reason == "invoice_overdue" %} -Recent invoice is overdue for payment. +{% elif notice_reason == "stale_audit_log_data" %} +Unable to verify current licenses in use, which delays invoicing for this customer. Last data upload: {{ last_audit_log_update }} {% elif notice_reason == "locally_deleted_realm_on_paid_plan" %}