Adjusted SMTP
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { requirePlatformRole } from "@/lib/session";
|
||||
import { getTenantRequestById, updateTenantRequestStatus } from "@/lib/db";
|
||||
import { sendRejectionEmail } from "@/lib/email";
|
||||
|
||||
/**
|
||||
* POST /api/admin/requests/[id]/reject
|
||||
* Reject a tenant request.
|
||||
* Reject a tenant request and notify the customer.
|
||||
*/
|
||||
export async function POST(
|
||||
request: Request,
|
||||
@@ -36,6 +37,14 @@ export async function POST(
|
||||
adminNotes,
|
||||
});
|
||||
|
||||
// Notify customer
|
||||
await sendRejectionEmail(
|
||||
tenantRequest.contactEmail,
|
||||
tenantRequest.contactName,
|
||||
tenantRequest.companyName,
|
||||
adminNotes
|
||||
);
|
||||
|
||||
return NextResponse.json({
|
||||
message: "Request rejected.",
|
||||
request: updated,
|
||||
|
||||
Reference in New Issue
Block a user