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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
11 changes: 8 additions & 3 deletions lib/plausible_web/templates/email/create_site_email.html.heex
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
You've activated your free 30-day trial of Plausible, a simple and privacy-friendly website analytics tool.
<br /><br />
You've activated
<%= if Plausible.ee?() do %>
your free 30-day trial of
<% end %>
Plausible, a simple and privacy-friendly website analytics tool. <br /><br />
Copy link
Contributor Author

@ruslandoga ruslandoga Oct 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trial upgrade email uses similar wording (just "Plausible") but it's not really used in CE:

Thanks for exploring Plausible, a simple and privacy-friendly alternative to Google Analytics. Your free 30-day trial is ending <%= @day %>, but you can keep using Plausible by upgrading to a paid plan.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to double-check if it's OK to use "Plausible" in CE

@ukutaht

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it's fine. I think "Plausible Community Edition" would be better though to be extra explicit.

I don't think the trial upgrade email should be sent at all in CE, though, doesn't seem to make much sense in self-hosting context?

<.unstyled_link href={"#{plausible_url()}/sites/new"}>Click here</.unstyled_link>
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.Users.on_trial?(@user) do %>
<%= if Plausible.ee?() and Plausible.Users.on_trial?(@user) 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 @@ -16,5 +16,7 @@ that makes the process simpler. We also have
<.unstyled_link href="https://plausible.io/docs/integration-guides">
integration guides
</.unstyled_link>
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.
for different site builders to help you start counting stats in no time.
<%= if Plausible.ee?() do %>
<br /><br />Do reply back to this email if you have any questions or need some guidance.
<% end %>
37 changes: 22 additions & 15 deletions test/plausible_web/email_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ defmodule PlausibleWeb.EmailTest do
end
end

describe "site_setup_success" do
describe "site setup emails" do
setup do
trial_user =
build(:user,
Expand All @@ -290,26 +290,33 @@ defmodule PlausibleWeb.EmailTest do
)

site = build(:site, members: [trial_user])
email = PlausibleWeb.Email.site_setup_success(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)
]

{: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 "render 'trial' and 'reply' blocks", %{emails: emails} do
for email <- emails do
assert email.html_body =~ @trial_message
assert email.html_body =~ @reply_message
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 "do not render 'trial' and 'reply' blocks", %{emails: emails} do
for email <- emails do
refute email.html_body =~ @trial_message
refute email.html_body =~ @reply_message
end
end
end

Expand Down