Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.
TypeScript analyticsanalytics-dashboardclickhouseelixirgoogle-analyticsmarketingopen-source-analyticsphoenixplausible-analyticspostgresqlprivacyprivacy-friendlyself-hostedsimple-analyticsstatisticstailwindcssweb-analyticswebsite-analyticswebsite-statswebsite-tracking
Add usage checking to cron
Uku Taht2bab36a4380e
diff --git a/config/runtime.exs b/config/runtime.exsindex afa748812b..ea90aae901 100644--- a/config/runtime.exs+++ b/config/runtime.exs@@ -177,6 +177,8 @@ if config_env() == :prod && !disable_cron doextra_cron = [# Daily at midday{"0 12 * * *", Plausible.Workers.SendTrialNotifications},+ # Daily at 14+ {"0 14 * * *", Plausible.Workers.CheckUsage},# Every 10 minutes{"*/10 * * * *", Plausible.Workers.ProvisionSslCertificates}]@@ -194,7 +196,8 @@ if config_env() == :prod && !disable_cron doextra_queues = [provision_ssl_certificates: 1,- trial_notification_emails: 1+ trial_notification_emails: 1,+ check_usage: 1]config :plausible, Oban,diff --git a/lib/plausible_web/templates/email/over_limit.html.eex b/lib/plausible_web/templates/email/over_limit.html.eexindex 56f6345a3d..c5d516d3e2 100644--- a/lib/plausible_web/templates/email/over_limit.html.eex+++ b/lib/plausible_web/templates/email/over_limit.html.eex@@ -8,14 +8,13 @@ We don't enforce any hard limits at the moment, we're still counting your stats<br /><br />In the last billing cycle (<%= date_format(@last_cycle.first) %> to <%= date_format(@last_cycle.first) %>), your account has used <%= @usage %> billable pageviews.<%= if @usage <= 20_000_000 do %>-- Based on that we recommend you select the <%= Plausible.Billing.Plans.suggested_plan_name(@usage) %> plan which runs at <%= Plausible.Billing.Plans.suggested_plan_cost(@usage) %>. You can also go with yearly billing to get 33% off.- <br /><br />- You can upgrade your subscription using our self-serve platform. The new charge will be prorated to reflect the amount you have already paid and the time until your current subscription is supposed to expire.- <br /><br />- <a href="https://plausible.io/settings">Click here</a> to go to your site settings. You can upgrade your subscription tier by clicking the 'change plan' link.+Based on that we recommend you select the <%= Plausible.Billing.Plans.suggested_plan_name(@usage) %> plan which runs at <%= Plausible.Billing.Plans.suggested_plan_cost(@usage) %>. You can also go with yearly billing to get 33% off.+<br /><br />+You can upgrade your subscription using our self-serve platform. The new charge will be prorated to reflect the amount you have already paid and the time until your current subscription is supposed to expire.+<br /><br />+<a href="https://plausible.io/settings">Click here</a> to go to your site settings. You can upgrade your subscription tier by clicking the 'change plan' link.<% else %>- This is more than our standard plans, so please reply back to this email to get a quote for your volume.+This is more than our standard plans, so please reply back to this email to get a quote for your volume.<% end %><br /><br />Were the last two months extraordinary and you don't expect these higher traffic levels to continue? Reply to this email and we'll figure it out.