diff --git a/lib/plausible_web/templates/billing/change_plan.html.eex b/lib/plausible_web/templates/billing/change_plan.html.eex index 254b98fad..314bfcfa6 100644 --- a/lib/plausible_web/templates/billing/change_plan.html.eex +++ b/lib/plausible_web/templates/billing/change_plan.html.eex @@ -47,9 +47,6 @@ @@ -65,7 +62,7 @@ Monthly pageviews - Price per month + Price diff --git a/lib/plausible_web/templates/billing/upgrade.html.eex b/lib/plausible_web/templates/billing/upgrade.html.eex index d57a8db80..5d2120481 100644 --- a/lib/plausible_web/templates/billing/upgrade.html.eex +++ b/lib/plausible_web/templates/billing/upgrade.html.eex @@ -43,9 +43,6 @@ diff --git a/lib/plausible_web/templates/email/trial_upgrade_email.html.eex b/lib/plausible_web/templates/email/trial_upgrade_email.html.eex index 467b5b517..a02a951ba 100644 --- a/lib/plausible_web/templates/email/trial_upgrade_email.html.eex +++ b/lib/plausible_web/templates/email/trial_upgrade_email.html.eex @@ -4,9 +4,7 @@ Thanks for exploring Plausible, a simple and privacy-friendly alternative to Goo

In the last month, your account has used <%= PlausibleWeb.AuthView.delimit_integer(@usage) %> billable pageviews<%= if @custom_events > 0, do: " and custom events in total", else: "" %>. <%= if @usage <= 20_000_000 do %> -Based on that we recommend you select the <%= @suggested_plan[:volume] %>/mo plan which runs at <%= @suggested_plan[:monthly_cost] %>/mo. - -You can also go with yearly billing to get 33% off on your plan. +Based on that we recommend you select the <%= @suggested_plan[:volume] %>/mo plan which runs at <%= @suggested_plan[:monthly_cost] %>/mo or <%= @suggested_plan[:yearly_cost] %>/yr when billed yearly.

<%= link("Upgrade now", to: "#{plausible_url()}/billing/upgrade") %>

diff --git a/lib/workers/check_usage.ex b/lib/workers/check_usage.ex index 22fb5c6de..d6703c811 100644 --- a/lib/workers/check_usage.ex +++ b/lib/workers/check_usage.ex @@ -54,6 +54,7 @@ defmodule Plausible.Workers.CheckUsage do if last_last_month > allowance && last_month > allowance do {_, last_cycle} = billing_mod.last_two_billing_cycles(subscriber) suggested_plan = Plausible.Billing.Plans.suggested_plan(subscriber, last_month) + template = PlausibleWeb.Email.over_limit_email(subscriber, last_month, last_cycle, suggested_plan) diff --git a/test/workers/check_usage_test.exs b/test/workers/check_usage_test.exs index f6924d84a..1289294ea 100644 --- a/test/workers/check_usage_test.exs +++ b/test/workers/check_usage_test.exs @@ -4,7 +4,6 @@ defmodule Plausible.Workers.CheckUsageTest do import Double import Plausible.TestUtils alias Plausible.Workers.CheckUsage - alias Plausible.Billing.Plans setup [:create_user, :create_site] @paddle_id_10k "558018" diff --git a/test/workers/send_trial_notifications_test.exs b/test/workers/send_trial_notifications_test.exs index 501fc4477..50496bf60 100644 --- a/test/workers/send_trial_notifications_test.exs +++ b/test/workers/send_trial_notifications_test.exs @@ -86,63 +86,63 @@ defmodule Plausible.Workers.SendTrialNotificationsTest do user = insert(:user) email = PlausibleWeb.Email.trial_upgrade_email(user, "today", {9_000, 0}) - assert email.html_body =~ "we recommend you select the 10k/mo plan which runs at $6/mo." + assert email.html_body =~ "we recommend you select the 10k/mo plan which runs at $6/mo" end test "suggests 100k/mo plan" do user = insert(:user) email = PlausibleWeb.Email.trial_upgrade_email(user, "today", {90_000, 0}) - assert email.html_body =~ "we recommend you select the 100k/mo plan which runs at $12/mo." + assert email.html_body =~ "we recommend you select the 100k/mo plan which runs at $12/mo" end test "suggests 200k/mo plan" do user = insert(:user) email = PlausibleWeb.Email.trial_upgrade_email(user, "today", {180_000, 0}) - assert email.html_body =~ "we recommend you select the 200k/mo plan which runs at $18/mo." + assert email.html_body =~ "we recommend you select the 200k/mo plan which runs at $18/mo" end test "suggests 500k/mo plan" do user = insert(:user) email = PlausibleWeb.Email.trial_upgrade_email(user, "today", {450_000, 0}) - assert email.html_body =~ "we recommend you select the 500k/mo plan which runs at $27/mo." + assert email.html_body =~ "we recommend you select the 500k/mo plan which runs at $27/mo" end test "suggests 1m/mo plan" do user = insert(:user) email = PlausibleWeb.Email.trial_upgrade_email(user, "today", {900_000, 0}) - assert email.html_body =~ "we recommend you select the 1M/mo plan which runs at $48/mo." + assert email.html_body =~ "we recommend you select the 1M/mo plan which runs at $48/mo" end test "suggests 2m/mo plan" do user = insert(:user) email = PlausibleWeb.Email.trial_upgrade_email(user, "today", {1_800_000, 0}) - assert email.html_body =~ "we recommend you select the 2M/mo plan which runs at $69/mo." + assert email.html_body =~ "we recommend you select the 2M/mo plan which runs at $69/mo" end test "suggests 5m/mo plan" do user = insert(:user) email = PlausibleWeb.Email.trial_upgrade_email(user, "today", {4_500_000, 0}) - assert email.html_body =~ "we recommend you select the 5M/mo plan which runs at $99/mo." + assert email.html_body =~ "we recommend you select the 5M/mo plan which runs at $99/mo" end test "suggests 10m/mo plan" do user = insert(:user) email = PlausibleWeb.Email.trial_upgrade_email(user, "today", {9_000_000, 0}) - assert email.html_body =~ "we recommend you select the 10M/mo plan which runs at $150/mo." + assert email.html_body =~ "we recommend you select the 10M/mo plan which runs at $150/mo" end test "suggests 20m/mo plan" do user = insert(:user) email = PlausibleWeb.Email.trial_upgrade_email(user, "today", {19_000_000, 0}) - assert email.html_body =~ "we recommend you select the 20M/mo plan which runs at $225/mo." + assert email.html_body =~ "we recommend you select the 20M/mo plan which runs at $225/mo" end test "does not suggest a plan above that" do