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
Fix email reports
Uku Taht9377a26a5d4e
diff --git a/lib/mix/tasks/send_email_reports.ex b/lib/mix/tasks/send_email_reports.exindex e79c0be5ae..02d1b00667 100644--- a/lib/mix/tasks/send_email_reports.ex+++ b/lib/mix/tasks/send_email_reports.ex@@ -21,7 +21,7 @@ defmodule Mix.Tasks.SendEmailReports dosites = Repo.all(from s in Plausible.Site,join: wr in Plausible.Site.WeeklyReport, on: wr.site_id == s.id,- left_join: se in "sent_weekly_reports", on: se.site_id == s.id and se.year == fragment("EXTRACT(year from (now() at time zone ?))", s.timezone) and se.week == fragment("EXTRACT(week from (now() at time zone ?))", s.timezone),+ left_join: se in "sent_weekly_reports", on: se.site_id == s.id and se.year == fragment("EXTRACT(isoyear from (now() at time zone ?))", s.timezone) and se.week == fragment("EXTRACT(week from (now() at time zone ?))", s.timezone),where: is_nil(se), # We haven't sent a report for this site on this weekwhere: fragment("EXTRACT(dow from (now() at time zone ?))", s.timezone) == 1, # It's monday in the local timezonewhere: fragment("EXTRACT(hour from (now() at time zone ?))", s.timezone) >= 9, # It's after 9am