1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { parseNotionDateDoc } from "https://esm.town/v/stevekrouse/parseNotionDateDoc";
import { email } from "https://esm.town/v/std/email?v=9";
import process from "node:process";
import { notionGetDatabaseEditedAfter } from "https://esm.town/v/stevekrouse/notionGetDatabaseEditedAfter";
export let notionDateMeDocNotify3 = async ({ lastRunAt }: Interval) => {
let newDocs = await notionGetDatabaseEditedAfter({
auth: process.env.notion,
databaseId: "725cb1d741674413b933a37a50f1961f",
date: lastRunAt,
});
if (newDocs.length)
await email({
text: JSON.stringify(
newDocs.map(parseNotionDateDoc),
null,
2,
),
subject: "New Date Me Doc",
});
return newDocs;
};