Remove exceptions for beta users

This commit is contained in:
Uku Taht 2019-10-31 15:16:08 +08:00
parent 60cccaecab
commit 03e6ffaba5
4 changed files with 3 additions and 27 deletions

View File

@ -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

View File

@ -1 +1 @@
<button class="paddle_button button button-sm" data-theme="none" data-product="<%= Plausible.Billing.Plans.paddle_id_for_plan(@plan) %>" data-email="<%= @conn.assigns[:current_user].email %>" data-disable-logout="true" data-coupon="<%= Plausible.Billing.coupon_for(@conn.assigns[:current_user]) %>" data-passthrough="<%= @conn.assigns[:current_user].id %>" data-success="/billing/success">Select</button>
<button class="paddle_button button button-sm" data-theme="none" data-product="<%= Plausible.Billing.Plans.paddle_id_for_plan(@plan) %>" data-email="<%= @conn.assigns[:current_user].email %>" data-disable-logout="true" data-passthrough="<%= @conn.assigns[:current_user].id %>" data-success="/billing/success">Select</button>

View File

@ -23,9 +23,6 @@
</p>
<p class="py-2">
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 %>
</p>
</div>
<div class="pt-8"></div>

View File

@ -7,9 +7,6 @@ Based on that we recommend you select the <%= suggested_plan_name(@pageviews) %>
<br /><br />
<%= link("Upgrade now", to: "https://plausible.io/billing/upgrade") %>
<br /><br />
<%= if Plausible.Billing.was_beta_user(@user) do %>
PS: Since you joined during the beta, you'll get 33% off at checkout.<br /><br />
<% end %>
Have any questions? Just reply to this email to get in touch!
<br /><br />
<br /><br />