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
Changes to the trial emails (#6108)
Marko Saric85b39ee27388
diff --git a/lib/plausible_web/email.ex b/lib/plausible_web/email.exindex b3863eeb95..56b097977d 100644--- a/lib/plausible_web/email.ex+++ b/lib/plausible_web/email.ex@@ -27,7 +27,7 @@ defmodule PlausibleWeb.Email dobase_email()|> to(user)|> tag("create-site-email")- |> subject("Your Plausible setup: Add your website details")+ |> subject("Add your first site to start tracking")|> render("create_site_email.html", user: user)end@@ -35,7 +35,7 @@ defmodule PlausibleWeb.Email dobase_email()|> to(user)|> tag("help-email")- |> subject("Your Plausible setup: Waiting for the first page views")+ |> subject("No traffic recorded yet")|> render("site_setup_help_email.html",user: user,site: site,@@ -43,15 +43,14 @@ defmodule PlausibleWeb.Email do)end- def site_setup_success(user, team, site) do+ def site_setup_success(user, site) dobase_email()|> to(user)|> tag("setup-success-email")- |> subject("Plausible is now tracking your website stats")+ |> subject("Your first visitor just showed up")|> render("site_setup_success_email.html",user: user,- site: site,- site_team: team+ site: site)end@@ -59,7 +58,7 @@ defmodule PlausibleWeb.Email dobase_email()|> to(user)|> tag("check-stats-email")- |> subject("Check your Plausible website stats")+ |> subject("How Plausible is different")|> render("check_stats_email.html", user: user)end@@ -91,19 +90,32 @@ defmodule PlausibleWeb.Email dobase_email()|> to(user)|> tag("trial-one-week-reminder")- |> subject("Your Plausible trial expires next week")+ |> subject("Your Plausible trial ends in one week")|> render("trial_one_week_reminder.html", user: user, team: team)end- def trial_upgrade_email(user, team, day, usage, suggested_volume) do+ def trial_ending_tomorrow_email(user, team, usage, suggested_volume) do+ base_email()+ |> to(user)+ |> tag("trial-ending-tomorrow")+ |> subject("Your Plausible trial ends tomorrow")+ |> render("trial_ending_tomorrow.html",+ user: user,+ team: team,+ custom_events: usage.custom_events,+ usage: usage.total,+ suggested_volume: suggested_volume+ )+ end++ def trial_ending_today_email(user, team, usage, suggested_volume) dobase_email()|> to(user)- |> tag("trial-upgrade-email")- |> subject("Your Plausible trial ends #{day}")- |> render("trial_upgrade_email.html",+ |> tag("trial-ending-today")+ |> subject("Your Plausible trial ends today")+ |> render("trial_ending_today.html",user: user,team: team,- day: day,custom_events: usage.custom_events,usage: usage.total,suggested_volume: suggested_volume@@ -114,7 +126,7 @@ defmodule PlausibleWeb.Email dobase_email()|> to(user)|> tag("trial-over-email")- |> subject("Your Plausible trial has ended")+ |> subject("Your Plausible trial has expired")|> render("trial_over_email.html",user: user,team: team,diff --git a/lib/plausible_web/templates/email/check_stats_email.html.heex b/lib/plausible_web/templates/email/check_stats_email.html.heexindex aaa5c15af9..9bc1b5f30d 100644--- a/lib/plausible_web/templates/email/check_stats_email.html.heex+++ b/lib/plausible_web/templates/email/check_stats_email.html.heex@@ -1,23 +1,5 @@-Plausible is tracking your website stats without compromising the user experience and the privacy of your visitors.-<br /><br /> Here's how to get even more out of your Plausible experience: <br /><br /> *-<a href="https://plausible.io/docs/custom-event-goals">Set up custom events</a>-and <a href="https://plausible.io/docs/pageview-goals">pageview goals</a>-to count actions you want your visitors to take<br />-* Running an ecommerce? Assign monetary values to custom events to track-<a href="https://plausible.io/docs/ecommerce-revenue-tracking">revenue attribution</a>-<br /> * Follow the journey from a landing page to conversion with-<a href="https://plausible.io/docs/funnel-analysis">funnel analysis</a>-<br /> *-<a href="https://plausible.io/docs/manual-link-tagging">- Tag your social media, email and paid links-</a>-to see which campaigns are responsible for most conversions<br /> *-<a href="https://plausible.io/docs/custom-props/introduction">Send custom properties</a>-to collect data that we don't track automatically <br /> * Explore our-<a href="https://plausible.io/docs/stats-api">stats API</a>-to retrieve your stats and our <a href="https://plausible.io/docs/sites-api">sites API</a>-to create and manage sites programmatically<br />-<br /><br />-<a href={plausible_url()}>View your Plausible dashboard now</a>-for the most valuable traffic insights at a glance. <br /><br />-Do reply back to this email if you have any questions or need some guidance.+It’s been a week since you started using Plausible.<br /><br />+We built Plausible because web analytics became too complex and too invasive.<br /><br />+We believe analytics should be simple to understand, fast to load and respectful of your visitors.<br /><br />+No cookies. No personal data. No surveillance. Just clear insights about how your website is performing.<br /><br />+<a href={plausible_url()}>Open your dashboard</a>diff --git a/lib/plausible_web/templates/email/create_site_email.html.heex b/lib/plausible_web/templates/email/create_site_email.html.heexindex 90a22ae8da..b87b760f69 100644--- a/lib/plausible_web/templates/email/create_site_email.html.heex+++ b/lib/plausible_web/templates/email/create_site_email.html.heex@@ -1,11 +1,6 @@-You've activated-<%= if ee?() do %>- your free 30-day trial of-<% end %>-{Plausible.product_name()}, an easy-to-use and privacy-friendly website analytics tool.+You’ve created your Plausible account but haven’t added a site yet.<br /><br />+Adding your first site only takes a minute and gets you from signup to seeing real traffic.<br /><br />+<a href={"#{plausible_url()}/sites/new"}>Add your first site</a><br /><br />-<a href={"#{plausible_url()}/sites/new"}>Click here</a>-to add your website URL, your timezone and install our JavaScript snippet to start collecting visitor statistics.-<%= if ee?() do %>- <br /><br />Do reply back to this email if you have any questions or need some guidance.-<% end %>+If you need help getting started, our documentation walks you through the setup step by step:<br />+<a href="https://plausible.io/docs">https://plausible.io/docs</a>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 46140deaf0..0d752bc525 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,18 +1,10 @@-<%= if 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 %>-To finish your setup for {@site.domain}, review+We haven't recorded any traffic for {@site.domain} yet.<br /><br />+This usually means Plausible has not been connected to your website or the tracking code has not been added correctly.<br /><br />+To finish your setup, check<a href={"#{plausible_url()}/#{URI.encode_www_form(@site.domain)}/installation?__team=#{@site_team.identifier}"}>your installation+</a>.<br /><br />+If something still doesn't look right, see our troubleshooting guide:<br />+<a href="https://plausible.io/docs/troubleshoot-integration">+ https://plausible.io/docs/troubleshoot-integration</a>-and start collecting visitor statistics. <br /><br />-This Plausible script is 45 times smaller than Google Analytics script so you’ll have a fast loading site while getting all the important traffic insights on one single page.-<br /><br /> We have a-<a href="https://plausible.io/wordpress-analytics-plugin">WordPress plugin</a>, a-<a href="https://plausible.io/gtm-template">Google Tag Manager template</a>-and <a href="https://plausible.io/docs/integration-guides">other integration guides</a>-too to help you start counting stats in no time.-<%= if 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_success_email.html.heex b/lib/plausible_web/templates/email/site_setup_success_email.html.heexindex 72e539acee..a9420a7aaa 100644--- a/lib/plausible_web/templates/email/site_setup_success_email.html.heex+++ b/lib/plausible_web/templates/email/site_setup_success_email.html.heex@@ -1,18 +1,4 @@-Congrats! We've recorded the first visitor on-<a href={"https://#{@site.domain}"}><%= @site.domain %></a>. Your traffic is now being counted without compromising the user experience and privacy of your visitors.-<br /><br />-Do check out your <a href={"#{plausible_url()}/#{URI.encode_www_form(@site.domain)}?__team=#{@site_team.identifier}"}>easy to use, fast-loading and privacy-friendly dashboard</a>.-<br /><br />-Something looks off? Take a look at our <a href="https://plausible.io/docs/troubleshoot-integration">installation troubleshooting guide</a>.-<br /><br />-<%= if (ee?() and Plausible.Teams.on_trial?(@site_team)) do %>- You're on a 30-day free trial with no obligations so do take your time to explore Plausible.- Here's how to get <a href="https://plausible.io/docs/your-plausible-experience">the most out of your Plausible experience</a>.- <br /><br />-<% end %>-PS: You can import your historical Google Analytics stats into your Plausible dashboard.-<a href="https://plausible.io/docs/google-analytics-import">Learn how our GA importer works</a>.-<br /><br />-<%= unless Plausible.ce?() do %>- Do reply back to this email if you have any questions. We're here to help.-<% end %>+Your first visitor is now visible in Plausible.<br /><br />+See where visitors come from, which pages they visit and which goals they complete, all in one simple dashboard.<br /><br />+Everything is designed to be understood at a glance. No custom reports. No digging through menus.<br /><br />+<a href={plausible_url()}>View your Plausible dashboard</a>diff --git a/lib/plausible_web/templates/email/trial_ending_today.html.heex b/lib/plausible_web/templates/email/trial_ending_today.html.heexnew file mode 100644index 0000000000..a6245a43ee--- /dev/null+++ b/lib/plausible_web/templates/email/trial_ending_today.html.heex@@ -0,0 +1,15 @@+Your Plausible trial ends today.<br /><br />+So far, your account has used {PlausibleWeb.AuthView.delimit_integer(@usage)} billable pageviews{if @custom_events >+ 0,+ do:+ " and custom events in total",+ else:+ ""}.<br /><br />+<%= if @suggested_volume == :enterprise do %>+ This exceeds our standard plans. Once the trial ends, your dashboard will be locked. Please reply to this email and we'll prepare a custom plan for your volume.+<% else %>+ To keep your dashboard unlocked and your stats collecting without interruption, select the {@suggested_volume} pageviews/month plan.<br /><br />+ <a href={PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan) <> "?__team=#{@team.identifier}"}>+ Upgrade your account+ </a>+<% end %>diff --git a/lib/plausible_web/templates/email/trial_ending_tomorrow.html.heex b/lib/plausible_web/templates/email/trial_ending_tomorrow.html.heexnew file mode 100644index 0000000000..2e97db9703--- /dev/null+++ b/lib/plausible_web/templates/email/trial_ending_tomorrow.html.heex@@ -0,0 +1,17 @@+Your Plausible trial ends tomorrow.<br /><br />+Over the last 30 days, your account has used {PlausibleWeb.AuthView.delimit_integer(@usage)} billable pageviews{if @custom_events >+ 0,+ do:+ " and custom events in total",+ else:+ ""}.<br /><br />+<%= if @suggested_volume == :enterprise do %>+ This exceeds our standard plans. Please reply to this email and we’ll prepare a custom plan for your volume.+<% else %>+ Based on your usage, the {@suggested_volume} pageviews/month plan would be the right fit.<br /><br />+ You can+ <a href={PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan) <> "?__team=#{@team.identifier}"}>+ upgrade your account+ </a>+ at any time to continue without interruption.+<% end %>diff --git a/lib/plausible_web/templates/email/trial_one_week_reminder.html.heex b/lib/plausible_web/templates/email/trial_one_week_reminder.html.heexindex 03d056a4f7..0e509a6357 100644--- a/lib/plausible_web/templates/email/trial_one_week_reminder.html.heex+++ b/lib/plausible_web/templates/email/trial_one_week_reminder.html.heex@@ -1,6 +1,8 @@-Time flies! Your 30-day free trial of Plausible will end next week. <br /><br />-Over the last three weeks, We hope you got to experience the potential benefits of having website stats in an easy to use dashboard while respecting the privacy of your visitors, not annoying them with the cookie and privacy notices and still having a fast loading site.-<br /><br />-In order to continue receiving valuable website traffic insights at a glance, you’ll need to-<a href={PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan) <> "?__team=#{@team.identifier}"}>upgrade your account</a>.-<br /><br /> If you have any questions or feedback for us, feel free to reply to this email.+Your Plausible trial ends in a week.<br /><br />+If Plausible has become part of how you check traffic and measure results, you can continue without interruption by choosing a subscription plan.<br /><br />+Everything you've set up will remain exactly as it is. No migration. No changes needed.<br /><br />+You can+<a href={PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan) <> "?__team=#{@team.identifier}"}>+ upgrade your account+</a>+at any time.diff --git a/lib/plausible_web/templates/email/trial_over_email.html.heex b/lib/plausible_web/templates/email/trial_over_email.html.heexindex de730c4dab..48dc08538d 100644--- a/lib/plausible_web/templates/email/trial_over_email.html.heex+++ b/lib/plausible_web/templates/email/trial_over_email.html.heex@@ -1,7 +1,8 @@-Your free Plausible trial has now expired. Upgrade your account to continue receiving valuable website traffic insights at a glance while respecting the privacy of your visitors and still having a fast loading site.-<br /><br />-+Your Plausible trial has expired and your dashboard is now locked.<br /><br />+We’re still recording visitor stats in the background, so nothing is lost while you decide.<br /><br />+When you’re ready, upgrade your account to unlock your dashboard and continue without interruption.<br /><br /><a href={PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan) <> "?__team=#{@team.identifier}"}>- Upgrade now+ Upgrade your account</a>-<br /><br /> We will keep recording stats for {@extra_offset} days to give you time to upgrade.+<br /><br />+We’ll keep recording stats for {@extra_offset} more days. If you upgrade during this time, your dashboard will simply unlock and continue as normal.diff --git a/lib/plausible_web/templates/email/welcome_email.html.heex b/lib/plausible_web/templates/email/welcome_email.html.heexindex fcdda8124f..c9f69f6d66 100644--- a/lib/plausible_web/templates/email/welcome_email.html.heex+++ b/lib/plausible_web/templates/email/welcome_email.html.heex@@ -1,23 +1,11 @@-We are building Plausible to provide a simple and ethical approach to tracking website visitors.-We're super excited to have you on board! <br /><br />-Here's how to get the most out of your Plausible experience: <br /><br /> *-<a href="https://plausible.io/docs/email-reports">Enable email reports</a>-and notifications for <a href="https://plausible.io/docs/traffic-spikes">traffic spikes</a>-<br /> *-<a href="https://plausible.io/docs/google-search-console-integration">- Integrate with Search Console+Welcome to Plausible.<br /><br />+You can go from signup to seeing your first visitor in just a few minutes.<br /><br />+Add your site and start tracking. That's it.<br /><br />+Once installed, your dashboard will start updating in real time. No cookies. No consent banners. No configuration required.<br /><br />+If you need help installing Plausible, see our integration guide:<br />+<a href="https://plausible.io/docs/troubleshoot-integration">+ https://plausible.io/docs/troubleshoot-integration</a>-to get keyword phrases people find your site with<br /> *-<a href="https://plausible.io/docs/users-roles">Invite team members and other collaborators</a>-<br /> * Set up easy goals including-<a href="https://plausible.io/docs/form-submissions-tracking">form submissions</a>,-<a href="https://plausible.io/docs/error-pages-tracking-404">404 error pages</a>,-<a href="https://plausible.io/docs/file-downloads-tracking">file downloads</a>-and <a href="https://plausible.io/docs/outbound-link-click-tracking">outbound link clicks</a>-<br /> * <a href="https://plausible.io/docs/excluding">Opt out from counting your own visits</a>-<br /> * If you're concerned about adblockers,-<a href="https://plausible.io/docs/proxy/introduction">set up a proxy to bypass them</a>-<br />-<br /><br /> Then you're ready to start exploring your fast loading, ethical and actionable-<a href="https://plausible.io/sites">Plausible dashboard</a>. <br /><br />-Have a question, feedback or need some guidance? Do reply back to this email.+<br /><br />+<a href={plausible_url()}>Open your Plausible dashboard</a>+<br /><br /> Enjoy exploring Plausible.diff --git a/lib/workers/send_site_setup_emails.ex b/lib/workers/send_site_setup_emails.exindex 7e44e783e9..68dfc20c5e 100644--- a/lib/workers/send_site_setup_emails.ex+++ b/lib/workers/send_site_setup_emails.ex@@ -90,7 +90,7 @@ defmodule Plausible.Workers.SendSiteSetupEmails dodefp send_setup_success_email(site) dofor owner <- site.owners do- PlausibleWeb.Email.site_setup_success(owner, site.team, site)+ PlausibleWeb.Email.site_setup_success(owner, site)|> Plausible.Mailer.send()enddiff --git a/lib/workers/send_trial_notifications.ex b/lib/workers/send_trial_notifications.exindex 085c73e749..be0c57d0bb 100644--- a/lib/workers/send_trial_notifications.ex+++ b/lib/workers/send_trial_notifications.ex@@ -67,7 +67,7 @@ defmodule Plausible.Workers.SendTrialNotifications dosuggested_volume = Plausible.Billing.Plans.suggest_volume(team, usage.total)for user <- users do- PlausibleWeb.Email.trial_upgrade_email(user, team, "tomorrow", usage, suggested_volume)+ PlausibleWeb.Email.trial_ending_tomorrow_email(user, team, usage, suggested_volume)|> Plausible.Mailer.send()endend@@ -77,7 +77,7 @@ defmodule Plausible.Workers.SendTrialNotifications dosuggested_volume = Plausible.Billing.Plans.suggest_volume(team, usage.total)for user <- users do- PlausibleWeb.Email.trial_upgrade_email(user, team, "today", usage, suggested_volume)+ PlausibleWeb.Email.trial_ending_today_email(user, team, usage, suggested_volume)|> Plausible.Mailer.send()endenddiff --git a/test/plausible_web/email_test.exs b/test/plausible_web/email_test.exsindex 2cb31b95ff..3c8a378c22 100644--- a/test/plausible_web/email_test.exs+++ b/test/plausible_web/email_test.exs@@ -53,10 +53,8 @@ defmodule PlausibleWeb.EmailTest do})refute email.html_body =~ "Hey John,"- refute email.html_body =~ plausible_link()refute email.text_body =~ "Hey John,"- refute email.text_body =~ plausible_url()endend@@ -352,79 +350,35 @@ defmodule PlausibleWeb.EmailTest doemails = [PlausibleWeb.Email.create_site_email(trial_user),PlausibleWeb.Email.site_setup_help(trial_user, site.team, site),- PlausibleWeb.Email.site_setup_success(trial_user, site.team, site)+ PlausibleWeb.Email.site_setup_success(trial_user, site)]- {:ok, emails: emails}+ {:ok, emails: emails, user: trial_user, site: site}end- @trial_message "trial"- @reply_message "reply back"-- @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+ test "create site email", %{user: user} do+ email = PlausibleWeb.Email.create_site_email(user)- assert Enum.any?(emails, fn email -> email.html_body =~ "Plausible Analytics" end)+ assert email.html_body =~+ "You’ve created your Plausible account but haven’t added a site yet."end- @tag :ce_build_only- 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+ test "site setup help email", %{user: user, site: site} do+ email = PlausibleWeb.Email.site_setup_help(user, site.team, site)- assert Enum.any?(emails, fn email -> email.html_body =~ "Plausible CE" end)+ assert email.html_body =~+ "We haven't recorded any traffic for #{site.domain} yet."end- end-- describe "text_body" do- @tag :ee_only- test "welcome_email (EE)" do- email =- Email.base_email()- |> Email.render("welcome_email.html", %{- user: build(:user, name: "John Doe"),- code: "123"- })-- assert email.text_body == """- Hey John,- We are building Plausible to provide a simple and ethical approach to tracking website visitors. We're super excited to have you on board!+ test "site setup success email", %{user: user, site: site} do+ email = PlausibleWeb.Email.site_setup_success(user, site)- Here's how to get the most out of your Plausible experience:-- * Enable email reports (https://plausible.io/docs/email-reports) and notifications for traffic spikes (https://plausible.io/docs/traffic-spikes)- * Integrate with Search Console (https://plausible.io/docs/google-search-console-integration) to get keyword phrases people find your site with- * Invite team members and other collaborators (https://plausible.io/docs/users-roles)- * Set up easy goals including form submissions (https://plausible.io/docs/form-submissions-tracking), 404 error pages (https://plausible.io/docs/error-pages-tracking-404), file downloads (https://plausible.io/docs/file-downloads-tracking) and outbound link clicks (https://plausible.io/docs/outbound-link-click-tracking)- * Opt out from counting your own visits (https://plausible.io/docs/excluding)- * If you're concerned about adblockers, set up a proxy to bypass them (https://plausible.io/docs/proxy/introduction)--- Then you're ready to start exploring your fast loading, ethical and actionable Plausible dashboard (https://plausible.io/sites).-- Have a question, feedback or need some guidance? Do reply back to this email.-- Regards,- The Plausible Team 💌-- ---- http://localhost:8000- {{{ pm:unsubscribe }}}\- """+ assert email.html_body =~ "Your first visitor is now visible in Plausible."end+ end- @tag :ce_build_only- test "welcome_email (CE)" do+ describe "text_body" do+ test "welcome email" doemail =Email.base_email()|> Email.render("welcome_email.html", %{@@ -432,29 +386,7 @@ defmodule PlausibleWeb.EmailTest docode: "123"})- assert email.text_body == """- Hey John,-- We are building Plausible to provide a simple and ethical approach to tracking website visitors. We're super excited to have you on board!-- Here's how to get the most out of your Plausible experience:-- * Enable email reports (https://plausible.io/docs/email-reports) and notifications for traffic spikes (https://plausible.io/docs/traffic-spikes)- * Integrate with Search Console (https://plausible.io/docs/google-search-console-integration) to get keyword phrases people find your site with- * Invite team members and other collaborators (https://plausible.io/docs/users-roles)- * Set up easy goals including form submissions (https://plausible.io/docs/form-submissions-tracking), 404 error pages (https://plausible.io/docs/error-pages-tracking-404), file downloads (https://plausible.io/docs/file-downloads-tracking) and outbound link clicks (https://plausible.io/docs/outbound-link-click-tracking)- * Opt out from counting your own visits (https://plausible.io/docs/excluding)- * If you're concerned about adblockers, set up a proxy to bypass them (https://plausible.io/docs/proxy/introduction)--- Then you're ready to start exploring your fast loading, ethical and actionable Plausible dashboard (https://plausible.io/sites).-- Have a question, feedback or need some guidance? Do reply back to this email.-- ---- http://localhost:8000- """+ assert email.text_body =~ "Welcome to Plausible."endenddiff --git a/test/workers/send_check_stats_emails_test.exs b/test/workers/send_check_stats_emails_test.exsindex 466f3413d9..dc4b784eb2 100644--- a/test/workers/send_check_stats_emails_test.exs+++ b/test/workers/send_check_stats_emails_test.exs@@ -44,7 +44,7 @@ defmodule Plausible.Workers.SendCheckStatsEmailsTest doassert_email_delivered_with(to: [{user.name, user.email}],- subject: "Check your Plausible website stats"+ subject: "How Plausible is different")end@@ -63,7 +63,7 @@ defmodule Plausible.Workers.SendCheckStatsEmailsTest doassert_email_delivered_with(to: [{user2.name, user2.email}],- subject: "Check your Plausible website stats"+ subject: "How Plausible is different")enddiff --git a/test/workers/send_site_setup_emails_test.exs b/test/workers/send_site_setup_emails_test.exsindex db7f962055..530a67efa6 100644--- a/test/workers/send_site_setup_emails_test.exs+++ b/test/workers/send_site_setup_emails_test.exs@@ -23,7 +23,7 @@ defmodule Plausible.Workers.SendSiteSetupEmailsTest doassert_email_delivered_with(to: [{user.name, user.email}],- subject: "Your Plausible setup: Waiting for the first page views"+ subject: "No traffic recorded yet")end@@ -48,7 +48,7 @@ defmodule Plausible.Workers.SendSiteSetupEmailsTest doassert_email_delivered_with(to: [{user.name, user.email}],- subject: "Plausible is now tracking your website stats"+ subject: "Your first visitor just showed up")end@@ -60,7 +60,7 @@ defmodule Plausible.Workers.SendSiteSetupEmailsTest doassert_email_delivered_with(to: [{user.name, user.email}],- subject: "Your Plausible setup: Waiting for the first page views"+ subject: "No traffic recorded yet")populate_stats(site, [@@ -71,7 +71,7 @@ defmodule Plausible.Workers.SendSiteSetupEmailsTest doassert_email_delivered_with(to: [{user.name, user.email}],- subject: "Plausible is now tracking your website stats"+ subject: "Your first visitor just showed up")end@@ -85,7 +85,7 @@ defmodule Plausible.Workers.SendSiteSetupEmailsTest doassert_email_delivered_with(to: [{user.name, user.email}],- subject: "Plausible is now tracking your website stats"+ subject: "Your first visitor just showed up")new_site(owner: user, consolidated: true, inserted_at: hours_ago(49))@@ -123,7 +123,7 @@ defmodule Plausible.Workers.SendSiteSetupEmailsTest doassert_email_delivered_with(to: [{user.name, user.email}],- subject: "Your Plausible setup: Add your website details"+ subject: "Add your first site to start tracking")endenddiff --git a/test/workers/send_trial_notifications_test.exs b/test/workers/send_trial_notifications_test.exsindex 22c2277158..e408be147c 100644--- a/test/workers/send_trial_notifications_test.exs+++ b/test/workers/send_trial_notifications_test.exs@@ -87,10 +87,9 @@ defmodule Plausible.Workers.SendTrialNotificationsTest doperform_job(SendTrialNotifications, %{})assert_delivered_email(- PlausibleWeb.Email.trial_upgrade_email(+ PlausibleWeb.Email.trial_ending_tomorrow_email(user,site.team,- "tomorrow",usage,suggested_volume)@@ -112,7 +111,7 @@ defmodule Plausible.Workers.SendTrialNotificationsTest doperform_job(SendTrialNotifications, %{})assert_delivered_email(- PlausibleWeb.Email.trial_upgrade_email(user, site.team, "today", usage, suggested_volume)+ PlausibleWeb.Email.trial_ending_today_email(user, site.team, usage, suggested_volume))end@@ -123,10 +122,9 @@ defmodule Plausible.Workers.SendTrialNotificationsTest dosuggested_volume = Plausible.Billing.Plans.suggest_volume(site.team, usage.total)email =- PlausibleWeb.Email.trial_upgrade_email(user, site.team, "today", usage, suggested_volume)+ PlausibleWeb.Email.trial_ending_today_email(user, site.team, usage, suggested_volume)- assert email.html_body =~- "In the last month, your account has used 9,000 billable pageviews."+ assert email.html_body =~ "So far, your account has used 9,000 billable pageviews."endtest "includes custom event note if user has used custom events" do@@ -136,10 +134,10 @@ defmodule Plausible.Workers.SendTrialNotificationsTest dosuggested_volume = Plausible.Billing.Plans.suggest_volume(site.team, usage.total)email =- PlausibleWeb.Email.trial_upgrade_email(user, site.team, "today", usage, suggested_volume)+ PlausibleWeb.Email.trial_ending_today_email(user, site.team, usage, suggested_volume)assert email.html_body =~- "In the last month, your account has used 9,100 billable pageviews and custom events in total."+ "So far, your account has used 9,100 billable pageviews and custom events in total."endtest "sends a trial over email the day after the trial ends" do@@ -183,9 +181,9 @@ defmodule Plausible.Workers.SendTrialNotificationsTest dosuggested_volume = Plausible.Billing.Plans.suggest_volume(site.team, usage.total)email =- PlausibleWeb.Email.trial_upgrade_email(user, site.team, "today", usage, suggested_volume)+ PlausibleWeb.Email.trial_ending_today_email(user, site.team, usage, suggested_volume)- assert email.html_body =~ "we recommend you select a 10k pageviews/month plan."+ assert email.html_body =~ "select the 10k pageviews/month plan."endtest "suggests 100k/mo plan" do@@ -195,9 +193,9 @@ defmodule Plausible.Workers.SendTrialNotificationsTest dosuggested_volume = Plausible.Billing.Plans.suggest_volume(site.team, usage.total)email =- PlausibleWeb.Email.trial_upgrade_email(user, site.team, "today", usage, suggested_volume)+ PlausibleWeb.Email.trial_ending_today_email(user, site.team, usage, suggested_volume)- assert email.html_body =~ "we recommend you select a 100k pageviews/month plan."+ assert email.html_body =~ "select the 100k pageviews/month plan."endtest "suggests 200k/mo plan" do@@ -207,9 +205,9 @@ defmodule Plausible.Workers.SendTrialNotificationsTest dosuggested_volume = Plausible.Billing.Plans.suggest_volume(site.team, usage.total)email =- PlausibleWeb.Email.trial_upgrade_email(user, site.team, "today", usage, suggested_volume)+ PlausibleWeb.Email.trial_ending_today_email(user, site.team, usage, suggested_volume)- assert email.html_body =~ "we recommend you select a 200k pageviews/month plan."+ assert email.html_body =~ "select the 200k pageviews/month plan."endtest "suggests 500k/mo plan" do@@ -219,9 +217,9 @@ defmodule Plausible.Workers.SendTrialNotificationsTest dosuggested_volume = Plausible.Billing.Plans.suggest_volume(site.team, usage.total)email =- PlausibleWeb.Email.trial_upgrade_email(user, site.team, "today", usage, suggested_volume)+ PlausibleWeb.Email.trial_ending_today_email(user, site.team, usage, suggested_volume)- assert email.html_body =~ "we recommend you select a 500k pageviews/month plan."+ assert email.html_body =~ "select the 500k pageviews/month plan."endtest "suggests 1m/mo plan" do@@ -231,9 +229,9 @@ defmodule Plausible.Workers.SendTrialNotificationsTest dosuggested_volume = Plausible.Billing.Plans.suggest_volume(site.team, usage.total)email =- PlausibleWeb.Email.trial_upgrade_email(user, site.team, "today", usage, suggested_volume)+ PlausibleWeb.Email.trial_ending_today_email(user, site.team, usage, suggested_volume)- assert email.html_body =~ "we recommend you select a 1M pageviews/month plan."+ assert email.html_body =~ "select the 1M pageviews/month plan."endtest "suggests 2m/mo plan" do@@ -243,9 +241,9 @@ defmodule Plausible.Workers.SendTrialNotificationsTest dosuggested_volume = Plausible.Billing.Plans.suggest_volume(site.team, usage.total)email =- PlausibleWeb.Email.trial_upgrade_email(user, site.team, "today", usage, suggested_volume)+ PlausibleWeb.Email.trial_ending_today_email(user, site.team, usage, suggested_volume)- assert email.html_body =~ "we recommend you select a 2M pageviews/month plan."+ assert email.html_body =~ "select the 2M pageviews/month plan."endtest "suggests 5m/mo plan" do@@ -255,9 +253,9 @@ defmodule Plausible.Workers.SendTrialNotificationsTest dosuggested_volume = Plausible.Billing.Plans.suggest_volume(site.team, usage.total)email =- PlausibleWeb.Email.trial_upgrade_email(user, site.team, "today", usage, suggested_volume)+ PlausibleWeb.Email.trial_ending_today_email(user, site.team, usage, suggested_volume)- assert email.html_body =~ "we recommend you select a 5M pageviews/month plan."+ assert email.html_body =~ "select the 5M pageviews/month plan."endtest "suggests 10m/mo plan" do@@ -267,9 +265,9 @@ defmodule Plausible.Workers.SendTrialNotificationsTest dosuggested_volume = Plausible.Billing.Plans.suggest_volume(site.team, usage.total)email =- PlausibleWeb.Email.trial_upgrade_email(user, site.team, "today", usage, suggested_volume)+ PlausibleWeb.Email.trial_ending_today_email(user, site.team, usage, suggested_volume)- assert email.html_body =~ "we recommend you select a 10M pageviews/month plan."+ assert email.html_body =~ "select the 10M pageviews/month plan."endtest "does not suggest a plan above that" do@@ -279,9 +277,10 @@ defmodule Plausible.Workers.SendTrialNotificationsTest dosuggested_volume = Plausible.Billing.Plans.suggest_volume(site.team, usage.total)email =- PlausibleWeb.Email.trial_upgrade_email(user, site.team, "today", usage, suggested_volume)+ PlausibleWeb.Email.trial_ending_today_email(user, site.team, usage, suggested_volume)- assert email.html_body =~ "please reply back to this email to get a quote for your volume"+ assert email.html_body =~+ "Please reply to this email and we'll prepare a custom plan for your volume"endtest "does not suggest a plan when user is switching to an enterprise plan" do@@ -292,9 +291,10 @@ defmodule Plausible.Workers.SendTrialNotificationsTest dosuggested_volume = Plausible.Billing.Plans.suggest_volume(site.team, usage.total)email =- PlausibleWeb.Email.trial_upgrade_email(user, site.team, "today", usage, suggested_volume)+ PlausibleWeb.Email.trial_ending_today_email(user, site.team, usage, suggested_volume)- assert email.html_body =~ "please reply back to this email to get a quote for your volume"+ assert email.html_body =~+ "Please reply to this email and we'll prepare a custom plan for your volume"endendend