Skip to content

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

Fix join condition

Uku Tahteed79902895d
diff --git a/lib/workers/notify_annual_renewal.ex b/lib/workers/notify_annual_renewal.ex
index 77d5240fd7..12f5f3e58e 100644
--- a/lib/workers/notify_annual_renewal.ex
+++ b/lib/workers/notify_annual_renewal.ex
@@ -12,9 +12,10 @@ defmodule Plausible.Workers.NotifyAnnualRenewal do
users =
Repo.all(
from u in Plausible.Auth.User,
- left_join: sent in "sent_renewal_notifications",
join: s in Plausible.Billing.Subscription,
on: s.user_id == u.id,
+ left_join: sent in "sent_renewal_notifications",
+ on: s.user_id == sent.user_id,
where: s.paddle_plan_id in @yearly_plans,
where:
s.next_bill_date > fragment("now()::date") and