chore: resend cleaning (#28)

This commit is contained in:
Riccardo Senica
2025-01-07 20:12:24 +01:00
committed by GitHub
parent a8de784981
commit 2616728128
3 changed files with 6 additions and 7 deletions

View File

@@ -9,6 +9,10 @@ export async function sender(
recipients: string[],
{ subject, template }: EmailTemplate
) {
if (!process.env.RESEND_KEY) {
throw new Error('RESEND_KEY is not set');
}
if (recipients.length === 0) {
console.info(`${subject} email skipped for having zero recipients`);
return true;