Export is PDF, RULE.md, and Print on US Letter, with every shared term, no member names, and a takeaway that points at Ask an organizer. Finished Rules keep type and place so the team can read folded counts without a database, Umami can sit beside the app with no cookies, and the person who holds the pen gets working PDF and RULE.md links 48 hours later.
36 lines
801 B
TypeScript
36 lines
801 B
TypeScript
/**
|
|
* Send the 48-hour print follow-up to pen-holders whose Rule is due.
|
|
*
|
|
* Usage (from repo root):
|
|
* node --env-file=.env --import tsx scripts/send-rule-follow-up.ts
|
|
*
|
|
* Cloudron runs the bundled copy hourly. Does not import Next request
|
|
* helpers.
|
|
*/
|
|
import { PrismaClient } from "@prisma/client";
|
|
import { sendDueRuleFollowUpEmails } from "../lib/server/ruleFollowUp";
|
|
|
|
const prisma = new PrismaClient();
|
|
|
|
async function main() {
|
|
const result = await sendDueRuleFollowUpEmails(prisma);
|
|
console.log(
|
|
JSON.stringify(
|
|
{
|
|
scope: "ruleFollowUp",
|
|
now: new Date().toISOString(),
|
|
...result,
|
|
},
|
|
null,
|
|
2,
|
|
),
|
|
);
|
|
}
|
|
|
|
main()
|
|
.catch((err) => {
|
|
console.error(err);
|
|
process.exitCode = 1;
|
|
})
|
|
.finally(() => prisma.$disconnect());
|