Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.
TypeScript analyticsanalytics-dashboardclickhouseelixirgoogle-analyticsmarketingopen-source-analyticsphoenixplausible-analyticspostgresqlprivacyprivacy-friendlyself-hostedsimple-analyticsstatisticstailwindcssweb-analyticswebsite-analyticswebsite-statswebsite-tracking
Remove trial mentions from site emails in CE (#4668)
ruslandoga8a9bdf85fba0
diff --git a/lib/plausible_web/templates/email/create_site_email.html.heex b/lib/plausible_web/templates/email/create_site_email.html.heexindex 92f5c96466..b17746e23f 100644--- a/lib/plausible_web/templates/email/create_site_email.html.heex+++ b/lib/plausible_web/templates/email/create_site_email.html.heex@@ -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 %>diff --git a/lib/plausible_web/templates/email/site_setup_help_email.html.heex b/lib/plausible_web/templates/email/site_setup_help_email.html.heexindex 8b4ad4e5d9..04b4d5d185 100644--- a/lib/plausible_web/templates/email/site_setup_help_email.html.heex+++ b/lib/plausible_web/templates/email/site_setup_help_email.html.heex@@ -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 %>@@ -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 %>diff --git a/test/plausible_web/email_test.exs b/test/plausible_web/email_test.exsindex 280664c06b..eabbb25a93 100644--- a/test/plausible_web/email_test.exs+++ b/test/plausible_web/email_test.exs@@ -283,30 +283,43 @@ defmodule PlausibleWeb.EmailTest doendend- describe "site_setup_success" do+ describe "site setup emails" dosetup dotrial_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)endend