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.

corporate: Revise internal billing emails for stale audit log data.

Lauryn Menard9edabf5ac8e3
diff --git a/corporate/lib/stripe.py b/corporate/lib/stripe.py
index 0216709e1b1..84195f89f81 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 48c76b7263a..1f143a1ce7f 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], "[email protected]")
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], "[email protected]")
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 2d72ad0e69e..00f9010fe4d 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" %}
<p>Reminder to re-evaluate the pricing and configure a new fixed-price plan accordingly.</p>
-{% elif notice_reason == "invoice_overdue" %}
-<p>Recent invoice is overdue for payment.</p>
+{% elif notice_reason == "stale_audit_log_data" %}
+<p>Unable to verify current licenses in use, which delays invoicing for this customer.</p>
<b>Last data upload</b>: {{ last_audit_log_update }}
{% elif notice_reason == "locally_deleted_realm_on_paid_plan" %}
<p>Investigate why remote realm is marked as locally deleted when it's on a paid plan.</p>
diff --git a/templates/zerver/emails/internal_billing_notice.subject.txt b/templates/zerver/emails/internal_billing_notice.subject.txt
index e7e88645856..636b3fa97c9 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 3cdf9b219cb..203275c6f98 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" %}