Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Fix email reports

Uku Tahtb9231b0cd067
diff --git a/lib/plausible_web/templates/email/weekly_report.html.eex b/lib/plausible_web/templates/email/weekly_report.html.eex
index be6ae610b3..b32e245bb9 100644
--- a/lib/plausible_web/templates/email/weekly_report.html.eex
+++ b/lib/plausible_web/templates/email/weekly_report.html.eex
@@ -453,7 +453,7 @@ body {
<!--[if mso]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding-right: 5px; padding-left: 5px; padding-top: 5px; padding-bottom: 5px; font-family: Arial, sans-serif"><![endif]-->
<div style="color:#555555;font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;line-height:120%;padding-top:5px;padding-right:5px;padding-bottom:5px;padding-left:5px;">
<div style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 12px; line-height: 14px; color: #555555;">
- <p style="font-size: 12px; line-height: 16px; text-align: right; margin: 0;"><span style="font-size: 14px;"><%= PlausibleWeb.StatsView.large_number_format(referrer[:count]) %></span></p>
+ <p style="font-size: 12px; line-height: 16px; text-align: right; margin: 0;"><span style="font-size: 14px;"><%= PlausibleWeb.StatsView.large_number_format(referrer["count"]) %></span></p>
</div>
</div>
<!--[if mso]></td></tr></table><![endif]-->
@@ -582,7 +582,7 @@ body {
<!--[if mso]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding-right: 5px; padding-left: 5px; padding-top: 5px; padding-bottom: 5px; font-family: Arial, sans-serif"><![endif]-->
<div style="color:#555555;font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;line-height:120%;padding-top:5px;padding-right:5px;padding-bottom:5px;padding-left:5px;">
<div style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 12px; line-height: 14px; color: #555555;">
- <p style="font-size: 12px; line-height: 16px; text-align: right; margin: 0;"><span style="font-size: 14px;"><%= PlausibleWeb.StatsView.large_number_format(page[:count]) %></span></p>
+ <p style="font-size: 12px; line-height: 16px; text-align: right; margin: 0;"><span style="font-size: 14px;"><%= PlausibleWeb.StatsView.large_number_format(page["count"]) %></span></p>
</div>
</div>
<!--[if mso]></td></tr></table><![endif]-->
diff --git a/test/workers/send_email_reports_test.exs b/test/workers/send_email_reports_test.exs
index 62bfb17e34..9c0cbf52f1 100644
--- a/test/workers/send_email_reports_test.exs
+++ b/test/workers/send_email_reports_test.exs
@@ -10,7 +10,7 @@ defmodule Plausible.Workers.EmailReportsTest do
describe "weekly reports" do
test "sends weekly report on Monday 9am local timezone" do
- site = insert(:site, timezone: "US/Eastern")
+ site = insert(:site, domain: "test-site.com", timezone: "US/Eastern")
insert(:weekly_report, site: site, recipients: ["[email protected]"])
# 2pm UTC is 10am EST
time = Timex.now() |> Timex.beginning_of_week() |> Timex.shift(hours: 14)