analytics/lib/plausible_web/templates/email/enterprise_over_limit_internal.html.eex
Marko Saric 0b00762591
Changes to the emails as discussed (#3540)
* Update over_limit.html.eex

* Update dashboard_locked.html.eex

* Update dashboard_locked.html.eex

* Update over_limit.html.eex

* Update dashboard_locked.html.eex

* fix tests

* stop querying owned_site_ids three times

... when querying for billing cycles. Adds an optional `owned_site_ids`
argument to the `usage_cycle` function.

* add penultimate billing cycle info to emails

This commit also refactors some code and adds unit tests to email templates

* use delimit_integer instead of large_number_format

... to display usage with exact numbers such as 1,099,999 instead of 1M

* add penultimate cycle date ranges and linebreaks

---------

Co-authored-by: RobertJoonas <56999674+RobertJoonas@users.noreply.github.com>
Co-authored-by: Robert Joonas <robertjoonas16@gmail.com>
2023-12-06 12:02:22 +00:00

9 lines
727 B
Elixir

Automated notice about an enterprise account that has gone over their limits. <br /><br />
Customer email: <%= @user.email %><br />
Last billing cycle: <%= PlausibleWeb.TextHelpers.format_date_range(@pageview_usage.last_cycle.date_range) %><br >
Last cycle pageview usage: <%= PlausibleWeb.AuthView.delimit_integer(@pageview_usage.last_cycle.total) %> billable pageviews<br />
Penultimate billing cycle: <%= PlausibleWeb.TextHelpers.format_date_range(@pageview_usage.penultimate_cycle.date_range) %><br >
Penultimate cycle pageview usage: <%= PlausibleWeb.AuthView.delimit_integer(@pageview_usage.penultimate_cycle.total) %> billable pageviews<br />
Site usage: <%= @site_usage %> / <%= @site_allowance %> allowed sites<br />