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 { sendUpgradeDoneEmail } from "@/lib/mail";
|
||||
import { formatDate } from "@/lib/utils";
|
||||
|
||||
const CTX = "upgrade-requests/[id]";
|
||||
|
||||
@@ -38,7 +40,15 @@ export const PATCH = withApiHandler<{ id: string }>(
|
||||
id: maestroUpgradeID,
|
||||
duration: Date.now() - t0,
|
||||
});
|
||||
return NextResponse.json({ ok: true, ...result });
|
||||
void sendUpgradeDoneEmail(
|
||||
result.maestroName,
|
||||
result.maestroEmail,
|
||||
result.registeredActivateStatus,
|
||||
result.registeredAccountType,
|
||||
result.requestedAccountType,
|
||||
formatDate(result.availableActivateDateTime)
|
||||
);
|
||||
return NextResponse.json({ ok: true, availableActivateDateTime: result.availableActivateDateTime });
|
||||
}
|
||||
|
||||
await rejectUpgradeRequest(maestroUpgradeID);
|
||||
|
||||
Reference in New Issue
Block a user