Phase 11. 이메일 발송 환경 및 자동 발송
This commit is contained in:
@@ -8,6 +8,8 @@ import {
|
||||
import { ApiError } from "@/lib/errors";
|
||||
import { withApiHandler } from "@/lib/api-handler";
|
||||
import { logger } from "@/lib/logger";
|
||||
import { sendExtensionDoneEmail } from "@/lib/mail";
|
||||
import { formatDate } from "@/lib/utils";
|
||||
|
||||
const CTX = "extension-requests/[id]";
|
||||
|
||||
@@ -38,7 +40,12 @@ export const PATCH = withApiHandler<{ id: string }>(
|
||||
id: maestroExtensionID,
|
||||
duration: Date.now() - t0,
|
||||
});
|
||||
return NextResponse.json({ ok: true, ...result });
|
||||
void sendExtensionDoneEmail(
|
||||
result.maestroName,
|
||||
result.maestroEmail,
|
||||
formatDate(result.availableActivateDateTime)
|
||||
);
|
||||
return NextResponse.json({ ok: true, availableActivateDateTime: result.availableActivateDateTime });
|
||||
}
|
||||
|
||||
await cancelExtensionRequest(maestroExtensionID);
|
||||
|
||||
Reference in New Issue
Block a user