diff --git a/services/apps/emails_worker/src/activities/weekly-analytics/getNextEmails.ts b/services/apps/emails_worker/src/activities/weekly-analytics/getNextEmails.ts index 36603288ed..9f55db901b 100644 --- a/services/apps/emails_worker/src/activities/weekly-analytics/getNextEmails.ts +++ b/services/apps/emails_worker/src/activities/weekly-analytics/getNextEmails.ts @@ -35,7 +35,10 @@ export async function weeklyGetNextEmails(): Promise { try { rows = await svc.postgres.reader.connection().query(` SELECT id as "tenantId", name as "tenantName" - FROM tenants WHERE "deletedAt" IS NULL; + FROM tenants + WHERE "deletedAt" IS NULL + AND plan IN ('Scale', 'Growth', 'Essential') + AND ("trialEndsAt" > NOW() OR "trialEndsAt" IS NULL); `) } catch (err) { throw new Error(err)