From 03e6ffaba5ed3fdd2c2f72e8bd266063991b8a7e Mon Sep 17 00:00:00 2001 From: Uku Taht Date: Thu, 31 Oct 2019 15:16:08 +0800 Subject: [PATCH] Remove exceptions for beta users --- lib/plausible/billing/billing.ex | 22 ++----------------- .../billing/_checkout_button.html.eex | 2 +- .../templates/billing/upgrade.html.eex | 3 --- .../email/trial_upgrade_email.html.eex | 3 --- 4 files changed, 3 insertions(+), 27 deletions(-) diff --git a/lib/plausible/billing/billing.ex b/lib/plausible/billing/billing.ex index d08793031..b63a41129 100644 --- a/lib/plausible/billing/billing.ex +++ b/lib/plausible/billing/billing.ex @@ -83,30 +83,12 @@ defmodule Plausible.Billing do end end - def coupon_for(user) do - if was_beta_user(user) do - "8FE5AF26" - end - end - - def was_beta_user(user) do - Timex.before?(user.inserted_at, ~D[2019-04-25]) - end - def trial_days_left(user) do - if Timex.before?(user.inserted_at, ~D[2019-04-24]) do - Timex.diff(~D[2019-05-25], Timex.today, :days) + 1 - else - 30 - Timex.diff(Timex.today, user.inserted_at, :days) - end + 30 - Timex.diff(Timex.today, user.inserted_at, :days) end def trial_end_date(user) do - if Timex.before?(user.inserted_at, ~D[2019-04-25]) do - ~D[2019-05-25] - else - Timex.shift(user.inserted_at, days: 30) |> NaiveDateTime.to_date - end + Timex.shift(user.inserted_at, days: 30) |> NaiveDateTime.to_date end def usage(user) do diff --git a/lib/plausible_web/templates/billing/_checkout_button.html.eex b/lib/plausible_web/templates/billing/_checkout_button.html.eex index 3e9baffc4..3865b025b 100644 --- a/lib/plausible_web/templates/billing/_checkout_button.html.eex +++ b/lib/plausible_web/templates/billing/_checkout_button.html.eex @@ -1 +1 @@ - + diff --git a/lib/plausible_web/templates/billing/upgrade.html.eex b/lib/plausible_web/templates/billing/upgrade.html.eex index 9af421a56..9d8173f24 100644 --- a/lib/plausible_web/templates/billing/upgrade.html.eex +++ b/lib/plausible_web/templates/billing/upgrade.html.eex @@ -23,9 +23,6 @@

All plans are on a monthly basis, cancel any time. - <%= if Plausible.Billing.was_beta_user(@conn.assigns[:current_user]) do %> - As a beta user, you will get 33% off on all plans. The coupon will be applied at checkout. - <% end %>

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 277f453bd..2f5cef7a6 100644 --- a/lib/plausible_web/templates/email/trial_upgrade_email.html.eex +++ b/lib/plausible_web/templates/email/trial_upgrade_email.html.eex @@ -7,9 +7,6 @@ Based on that we recommend you select the <%= suggested_plan_name(@pageviews) %>

<%= link("Upgrade now", to: "https://plausible.io/billing/upgrade") %>

-<%= if Plausible.Billing.was_beta_user(@user) do %> - PS: Since you joined during the beta, you'll get 33% off at checkout.

-<% end %> Have any questions? Just reply to this email to get in touch!