diff --git a/apps/organizations_ext/email.py b/apps/organizations_ext/email.py index cc1cfd75..ad99cccf 100644 --- a/apps/organizations_ext/email.py +++ b/apps/organizations_ext/email.py @@ -21,13 +21,13 @@ class MetQuotaEmail(DetailEmail): base_url = settings.GLITCHTIP_URL.geturl() organization = self.object subscription_link = f"{base_url}/{organization.slug}/settings/subscription" - context["organization_name"] = organization.name product = Product.objects.filter( plan__subscriptions__customer__subscriber=organization, plan__subscriptions__status="active", ).first() context.update( { + "organization": organization, "product": product, "event_limit": product.metadata.get("events") if product else None, "subscription_link": subscription_link, diff --git a/apps/organizations_ext/templates/organizations/met-quota-drip.html b/apps/organizations_ext/templates/organizations/met-quota-drip.html index fdd57265..334f365d 100644 --- a/apps/organizations_ext/templates/organizations/met-quota-drip.html +++ b/apps/organizations_ext/templates/organizations/met-quota-drip.html @@ -1,3 +1,42 @@ +{% extends "email/email_base.html" %} {% load static settings %} -Met event quota for {{ organization_name }} -
 
 
 

You have reached your event quota

Organization: {{ organization_name }}

Your plan allows for {{ event_limit }} events per month, and your projects have exceeded that limit.

You will no longer receive events until the monthly cycle resets, or you upgrade your plan.

 
Manage Subscription
                                                           
\ No newline at end of file +{% block title_text %} + Met event quota for {{ organization.name|striptags }} +{% endblock %} +{% block content %} + + + + + + + + + +
+

+ Hello and thank you for using GlitchTip. We noticed your organization {{ organization.name|striptags }} + has exceeded its monthly event limit on your {{ product.name }} and wanted to give you a heads up. + Your plan allows for {{event_limit}} events, but for the current billing period we have received + ###EVENT_COUNT### events for your organization. Here are a couple options to avoid this in the future. +

+
+
    +
  • + Upgrade + to a new plan for more events +
  • +
  • + Configure your SDK to send a lower rate of events to GlitchTip +
  • +
+

+ In the meantime, we have placed a {{ organization.event_throttle_rate }}% throttle on incoming + events from projects on your organization account for this billing period. If you choose to + upgrade your plan, this throttle will be removed. Otherwise, it will reset at the beginning + of your next billing cycle. +

+
+ + +{% endblock %} diff --git a/apps/organizations_ext/templates/organizations/met-quota-drip.txt b/apps/organizations_ext/templates/organizations/met-quota-drip.txt index 1499066a..d35474c3 100644 --- a/apps/organizations_ext/templates/organizations/met-quota-drip.txt +++ b/apps/organizations_ext/templates/organizations/met-quota-drip.txt @@ -1,5 +1,12 @@ -You have reached your event quota -Organization: {{ organization_name }} -Your plan allows for {{ event_limit }} events per month, and your projects have exceeded that limit. -You will no longer receive events until the monthly cycle resets, or you upgrade your plan. -Manage your subscription: {{ subscription_link }}" \ No newline at end of file +Hello and thank you for using GlitchTip. We noticed your organization {{ organization.name|striptags }} +has exceeded its monthly event limit on your {{ product.name }} and wanted to give you a heads up. +Your plan allows for {{ event_limit }} events, but for the current billing period we have received +###EVENT_COUNT### events for your organization. Here are a couple options to avoid this in the future. + +Upgrade to a new plan for more events at this link: {{ subscription_link }} + +Configure your SDK to send a lower rate of events to GlitchTip + +In the meantime, we have placed a {{ organization.event_throttle_rate }}% throttle on incoming events +from projects on your organization account for this billing period. If you choose to upgrade your plan, +this throttle will be removed. Otherwise, it will reset at the beginning of your next billing cycle. diff --git a/templates/email/email_base.html b/templates/email/email_base.html new file mode 100644 index 00000000..257a97e6 --- /dev/null +++ b/templates/email/email_base.html @@ -0,0 +1,214 @@ +{% load static settings %} + + + + + + + + + + + + + + + {% block title_text %}{% endblock %} + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + +
+ alt_text +
+ + + {% block content %}{% endblock %} + +
+
+ + + +
+ + +
+ +