Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove trial mentions from site emails in CE #4668

Merged
merged 3 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions lib/plausible_web/templates/email/create_site_email.html.heex
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
You've activated your free 30-day trial of Plausible, a simple and privacy-friendly website analytics tool.
You've activated
<%= if Plausible.ee?() do %>
your free 30-day trial of
<% end %>
<%= Plausible.product_name() %>, a simple and privacy-friendly website analytics tool.
<br /><br />
<a href={"#{plausible_url()}/sites/new"}>Click here</a>
to add your website URL, your timezone and install our one-line JavaScript snippet to start collecting visitor statistics.
<br /><br /> Do reply back to this email if you have any questions or need some guidance.
<%= if Plausible.ee?() do %>
<br /><br />Do reply back to this email if you have any questions or need some guidance.
<% end %>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= if Plausible.Teams.on_trial?(@site.team) do %>
<%= if Plausible.ee?() and Plausible.Teams.on_trial?(@site.team) do %>
You signed up for a free 30-day trial of Plausible, a simple and privacy-friendly website analytics tool.
<br /><br />
<% end %>
Expand All @@ -9,4 +9,6 @@ This Plausible script is 45 times smaller than Google Analytics script so you’
<br /><br /> On WordPress? We have a
<a href="https://plausible.io/wordpress-analytics-plugin">WordPress plugin</a> that makes the process simpler. We also have
<a href="https://plausible.io/docs/integration-guides">integration guides</a> for different site builders to help you start counting stats in no time.
<br /><br /> Do reply back to this email if you have any questions or need some guidance.
<%= if Plausible.ee?() do %>
<br /><br /> Do reply back to this email if you have any questions or need some guidance.
<% end %>
43 changes: 28 additions & 15 deletions test/plausible_web/email_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -283,30 +283,43 @@ defmodule PlausibleWeb.EmailTest do
end
end

describe "site_setup_success" do
describe "site setup emails" do
setup do
trial_user = new_user(trial_expiry_date: Date.add(Date.utc_today(), 100))
site = new_site(owner: trial_user)
email = PlausibleWeb.Email.site_setup_success(trial_user, team_of(trial_user), site)
{:ok, email: email}

emails = [
PlausibleWeb.Email.create_site_email(trial_user),
PlausibleWeb.Email.site_setup_help(trial_user, site),
PlausibleWeb.Email.site_setup_success(trial_user, site.team, site)
]

{:ok, emails: emails}
end

@tag :ee_only
test "renders 'trial' and 'reply' blocks", %{email: email} do
assert email.html_body =~
"You're on a 30-day free trial with no obligations so do take your time to explore Plausible."
@trial_message "trial"
@reply_message "reply back"

assert email.html_body =~
"Do reply back to this email if you have any questions. We're here to help."
@tag :ee_only
test "has 'trial' and 'reply' blocks, correct product name", %{emails: emails} do
for email <- emails do
assert email.html_body =~ @trial_message
assert email.html_body =~ @reply_message
refute email.html_body =~ "Plausible CE"
end

assert Enum.any?(emails, fn email -> email.html_body =~ "Plausible Analytics" end)
end

@tag :ce_build_only
test "does not render 'trial' and 'reply' blocks", %{email: email} do
refute email.html_body =~
"You're on a 30-day free trial with no obligations so do take your time to explore Plausible."

refute email.html_body =~
"Do reply back to this email if you have any questions. We're here to help."
test "no 'trial' or 'reply' blocks, correct product name", %{emails: emails} do
for email <- emails do
refute email.html_body =~ @trial_message
refute email.html_body =~ @reply_message
refute email.html_body =~ "Plausible Analytics"
end

assert Enum.any?(emails, fn email -> email.html_body =~ "Plausible CE" end)
end
end

Expand Down
Loading