From 73923404b07f07244bfee599d8c08fd376bf797e Mon Sep 17 00:00:00 2001 From: hq1 Date: Tue, 2 Jan 2024 13:18:51 +0100 Subject: [PATCH] Improve approaching accept_traffic_until e-mail (#3660) * Improve approaching accept_traffic_until e-mail * fixup * format --- lib/plausible_web/email.ex | 2 +- .../email/approaching_accept_traffic_until.html.heex | 7 +++---- test/plausible_web/email_test.exs | 3 ++- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/plausible_web/email.ex b/lib/plausible_web/email.ex index fd1c7300a..113ba25f1 100644 --- a/lib/plausible_web/email.ex +++ b/lib/plausible_web/email.ex @@ -358,7 +358,7 @@ defmodule PlausibleWeb.Email do |> to(user.email) |> tag("drop-traffic-warning-first") |> subject("We'll stop counting your stats") - |> render("approaching_accept_traffic_until.html", time: "next week") + |> render("approaching_accept_traffic_until.html", time: "next week", user: user) end def approaching_accept_traffic_until_tomorrow(user) do diff --git a/lib/plausible_web/templates/email/approaching_accept_traffic_until.html.heex b/lib/plausible_web/templates/email/approaching_accept_traffic_until.html.heex index f5e12414a..88e2f71e6 100644 --- a/lib/plausible_web/templates/email/approaching_accept_traffic_until.html.heex +++ b/lib/plausible_web/templates/email/approaching_accept_traffic_until.html.heex @@ -1,8 +1,7 @@ You used to have an active account with Plausible Analytics, a simple, lightweight, open source and privacy-first Google Analytics alternative. - +

We've noticed that you're still sending us stats so we're writing to inform you that we'll stop accepting stats from your sites <%= @time %>. We're an independent, bootstrapped service and we don't sell your data, so this will reduce our server costs and help keep us sustainable. - -If you'd like to continue counting your site stats in a privacy-friendly way, please +

If you'd like to continue counting your site stats in a privacy-friendly way, please login to your Plausible account and start a subscription. - +

Do you have any questions or need help with anything? Just reply to this email and we'll gladly help. diff --git a/test/plausible_web/email_test.exs b/test/plausible_web/email_test.exs index fc52753c4..9a23e0612 100644 --- a/test/plausible_web/email_test.exs +++ b/test/plausible_web/email_test.exs @@ -247,13 +247,14 @@ defmodule PlausibleWeb.EmailTest do describe "approaching accept_traffic_until" do test "renders first warning" do - user = build(:user) + user = build(:user, name: "John Doe") %{html_body: body, subject: subject} = PlausibleWeb.Email.approaching_accept_traffic_until(user) assert subject == "We'll stop counting your stats" assert body =~ plausible_link() + assert body =~ "Hey John," assert body =~ "We've noticed that you're still sending us stats so we're writing to inform you that we'll stop accepting stats from your sites next week."