mirror of
https://github.com/zulip/zulip.git
synced 2025-11-11 09:27:43 +00:00
stripe: Use a common email template for internal billing notices.
This is a prep commit which replaces the 'invoice_overdue' and 'reminder_to_review_plan' email templates with 'internal_billing_notice'. This will help us to use the same template as we plan to send an email to sales when a remote realm with paid plan attached is locally deleted.
This commit is contained in:
committed by
Tim Abbott
parent
220c4cbdc2
commit
5d58a39087
@@ -4859,9 +4859,10 @@ def invoice_plans_as_needed(event_time: Optional[datetime] = None) -> None:
|
|||||||
"billing_entity": billing_session.billing_entity_display_name,
|
"billing_entity": billing_session.billing_entity_display_name,
|
||||||
"end_date": plan.end_date.strftime("%Y-%m-%d"),
|
"end_date": plan.end_date.strftime("%Y-%m-%d"),
|
||||||
"support_url": billing_session.support_url(),
|
"support_url": billing_session.support_url(),
|
||||||
|
"notice_reason": "fixed_price_plan_ends_soon",
|
||||||
}
|
}
|
||||||
send_email(
|
send_email(
|
||||||
"zerver/emails/reminder_to_review_plan",
|
"zerver/emails/internal_billing_notice",
|
||||||
to_emails=[BILLING_SUPPORT_EMAIL],
|
to_emails=[BILLING_SUPPORT_EMAIL],
|
||||||
from_address=FromAddress.tokenized_no_reply_address(),
|
from_address=FromAddress.tokenized_no_reply_address(),
|
||||||
context=context,
|
context=context,
|
||||||
@@ -4881,9 +4882,10 @@ def invoice_plans_as_needed(event_time: Optional[datetime] = None) -> None:
|
|||||||
context = {
|
context = {
|
||||||
"support_url": billing_session.support_url(),
|
"support_url": billing_session.support_url(),
|
||||||
"last_audit_log_update": last_audit_log_update_string,
|
"last_audit_log_update": last_audit_log_update_string,
|
||||||
|
"notice_reason": "invoice_overdue",
|
||||||
}
|
}
|
||||||
send_email(
|
send_email(
|
||||||
"zerver/emails/invoice_overdue",
|
"zerver/emails/internal_billing_notice",
|
||||||
to_emails=[BILLING_SUPPORT_EMAIL],
|
to_emails=[BILLING_SUPPORT_EMAIL],
|
||||||
from_address=FromAddress.tokenized_no_reply_address(),
|
from_address=FromAddress.tokenized_no_reply_address(),
|
||||||
context=context,
|
context=context,
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
{% extends "zerver/emails/email_base_default.html" %}
|
{% extends "zerver/emails/email_base_default.html" %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
|
{% if notice_reason == "fixed_price_plan_ends_soon" %}
|
||||||
<p>Reminder to re-evaluate the pricing and configure a new fixed-price plan accordingly.</p>
|
<p>Reminder to re-evaluate the pricing and configure a new fixed-price plan accordingly.</p>
|
||||||
|
{% elif notice_reason == "invoice_overdue" %}
|
||||||
|
<b>Last data upload</b>: {{ last_audit_log_update }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<br /><br />
|
<br /><br />
|
||||||
|
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
{% 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 due to stale data
|
||||||
|
{% endif %}
|
||||||
7
templates/zerver/emails/internal_billing_notice.txt
Normal file
7
templates/zerver/emails/internal_billing_notice.txt
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{% 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" %}
|
||||||
|
Last data upload: {{ last_audit_log_update }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
Support URL: {{ support_url }}
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
{% extends "zerver/emails/email_base_default.html" %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
<b>Support URL</b>: <a href="{{ support_url }}">{{ support_url }}</a>
|
|
||||||
|
|
||||||
<br /><br />
|
|
||||||
|
|
||||||
<b>Last data upload</b>: {{ last_audit_log_update }}
|
|
||||||
|
|
||||||
{% endblock %}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Invoice overdue due to stale data
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
Support URL: {{ support_url }}
|
|
||||||
|
|
||||||
Last data upload: {{ last_audit_log_update }}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Fixed-price plan for {{billing_entity}} ends on {{end_date}}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
Reminder to re-evaluate the pricing and configure a new fixed-price plan accordingly.
|
|
||||||
|
|
||||||
Support URL: {{ support_url }}
|
|
||||||
Reference in New Issue
Block a user