mirror of
https://github.com/plausible/analytics.git
synced 2024-12-25 18:48:06 +03:00
Add notice about whether a subscription is yearly
This commit is contained in:
parent
09658810b8
commit
65ac83f2ff
@ -113,11 +113,23 @@ defmodule PlausibleWeb.Email do
|
|||||||
end
|
end
|
||||||
|
|
||||||
def over_limit_email(user, usage, last_cycle) do
|
def over_limit_email(user, usage, last_cycle) do
|
||||||
|
yearly_plan_ids =
|
||||||
|
Plausible.Billing.Plans.plans()
|
||||||
|
|> Map.fetch!(:yearly)
|
||||||
|
|> Enum.map(fn {_limit, plan} -> plan[:product_id] end)
|
||||||
|
|
||||||
|
subject_pre =
|
||||||
|
if user.subscription.paddle_plan_id in yearly_plan_ids do
|
||||||
|
"[YEARLY] "
|
||||||
|
else
|
||||||
|
""
|
||||||
|
end
|
||||||
|
|
||||||
base_email()
|
base_email()
|
||||||
# Temporary testing
|
# Temporary testing
|
||||||
|> to(["uku@plausible.io"])
|
|> to(["uku@plausible.io"])
|
||||||
|> tag("over-limit")
|
|> tag("over-limit")
|
||||||
|> subject("You have outgrown your Plausible subscription tier ")
|
|> subject("#{subject_pre}You have outgrown your Plausible subscription tier ")
|
||||||
|> render("over_limit.html", %{
|
|> render("over_limit.html", %{
|
||||||
user: user,
|
user: user,
|
||||||
usage: usage,
|
usage: usage,
|
||||||
|
Loading…
Reference in New Issue
Block a user