Skip to content

Commit ffd212e

Browse files
Betreegitbook-bot
authored andcommitted
GitBook: [v2] one page modified
1 parent af0e2bc commit ffd212e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

internal/newsletter.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ Users who create new platform accounts and opt-in to the newsletter need to be a
1414

1515
```sql
1616
-- Export email for newsletter
17-
SELECT "createdAt", "firstName", "lastName", "email"
18-
FROM "Users"
17+
SELECT u."createdAt", c.name as full_name, "email"
18+
FROM "Users" u
19+
inner join "Collectives" c on u."CollectiveId" = c.id
1920
WHERE "newsletterOptIn" IS TRUE
20-
AND "deletedAt" IS NULL
21-
AND "createdAt" >= current_date - INTERVAL '2 months' -- Optional: to get only last 2 month's emails
21+
AND u."deletedAt" IS NULL
22+
AND u."createdAt" >= current_date - INTERVAL '2 months' -- Optional: to get only last 2 month's emails
2223
```
2324

2425
### Content

0 commit comments

Comments
 (0)