diff --git a/lib/plausible/billing/enterprise_plan.ex b/lib/plausible/billing/enterprise_plan.ex
index 2a224cce2..9589c1e0d 100644
--- a/lib/plausible/billing/enterprise_plan.ex
+++ b/lib/plausible/billing/enterprise_plan.ex
@@ -2,6 +2,8 @@ defmodule Plausible.Billing.EnterprisePlan do
use Ecto.Schema
import Ecto.Changeset
+ @type t() :: %__MODULE__{}
+
@required_fields [
:user_id,
:paddle_plan_id,
diff --git a/lib/plausible/billing/plan.ex b/lib/plausible/billing/plan.ex
index 78a6b8551..132a7c585 100644
--- a/lib/plausible/billing/plan.ex
+++ b/lib/plausible/billing/plan.ex
@@ -4,7 +4,7 @@ defmodule Plausible.Billing.Plan do
use Ecto.Schema
import Ecto.Changeset
- @type t() :: %__MODULE__{} | :enterprise
+ @type t() :: %__MODULE__{}
embedded_schema do
# Due to grandfathering, we sometimes need to check the "generation" (e.g.
diff --git a/lib/plausible/billing/plans.ex b/lib/plausible/billing/plans.ex
index 901ed2d96..15f56e496 100644
--- a/lib/plausible/billing/plans.ex
+++ b/lib/plausible/billing/plans.ex
@@ -105,6 +105,8 @@ defmodule Plausible.Billing.Plans do
end)
end
+ @spec get_subscription_plan(nil | Subscription.t()) ::
+ nil | :free_10k | Plan.t() | EnterprisePlan.t()
def get_subscription_plan(nil), do: nil
def get_subscription_plan(subscription) do
diff --git a/lib/plausible_web/components/billing/notice.ex b/lib/plausible_web/components/billing/notice.ex
index 409d4b4bc..eafd5b28e 100644
--- a/lib/plausible_web/components/billing/notice.ex
+++ b/lib/plausible_web/components/billing/notice.ex
@@ -302,17 +302,24 @@ defmodule PlausibleWeb.Components.Billing.Notice do
defp upgrade_call_to_action(assigns) do
billable_user = Plausible.Users.with_subscription(assigns.billable_user)
- plan =
- Plans.get_regular_plan(billable_user.subscription, only_non_expired: true)
-
- trial? = Plausible.Users.on_trial?(assigns.billable_user)
- growth? = plan && plan.kind == :growth
+ upgrade_assistance_required? =
+ case Plans.get_subscription_plan(billable_user.subscription) do
+ %Plausible.Billing.Plan{kind: :business} -> true
+ %Plausible.Billing.EnterprisePlan{} -> true
+ _ -> false
+ end
cond do
assigns.billable_user.id !== assigns.current_user.id ->
~H"please reach out to the site owner to upgrade their subscription"
- growth? || trial? ->
+ upgrade_assistance_required? ->
+ ~H"""
+ please contact hello@plausible.io
+ to upgrade your subscription
+ """
+
+ true ->
~H"""
please
<.link
@@ -322,12 +329,6 @@ defmodule PlausibleWeb.Components.Billing.Notice do
upgrade your subscription
"""
-
- true ->
- ~H"""
- please contact hello@plausible.io
- to upgrade your subscription
- """
end
end
diff --git a/lib/plausible_web/templates/site/settings_funnels.html.heex b/lib/plausible_web/templates/site/settings_funnels.html.heex
index d583c341a..e668b3e21 100644
--- a/lib/plausible_web/templates/site/settings_funnels.html.heex
+++ b/lib/plausible_web/templates/site/settings_funnels.html.heex
@@ -12,12 +12,13 @@
Compose Goals into Funnels
+