mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 00:32:43 +10:00
25 lines
723 B
TypeScript
25 lines
723 B
TypeScript
import { DocumentReminderInterval } from '@documenso/prisma/client';
|
|
|
|
import type { JobDefinition } from '../../client/_internal/job';
|
|
|
|
const SEND_DAILY_REMINDER_EMAIL_JOB_ID = 'send.daily.reminder.email';
|
|
|
|
export const SEND_DAILY_REMINDER_EMAIL_JOB = {
|
|
id: SEND_DAILY_REMINDER_EMAIL_JOB_ID,
|
|
name: 'Send Daily Reminder Email',
|
|
version: '1.0.0',
|
|
trigger: {
|
|
type: 'cron',
|
|
schedule: '0 0 * * *',
|
|
name: SEND_DAILY_REMINDER_EMAIL_JOB_ID,
|
|
},
|
|
handler: async ({ io }) => {
|
|
const handler = await import('./send-reminder.handler');
|
|
|
|
await handler.run({
|
|
io,
|
|
interval: DocumentReminderInterval.DAILY,
|
|
});
|
|
},
|
|
} as const satisfies JobDefinition<typeof SEND_DAILY_REMINDER_EMAIL_JOB_ID>;
|