import { sendEmail } from "@/lib/mail.utils"

export async function POST() {
    const sender = {
        name: 'Kevos Official',
        address: 'no-reply@kevosattire.com',
    }

    const recipients = [{
        name: 'Fernando Delgado',
        address: 'arcjcb11@gmail.com',
    }]

    try{
        const result = await sendEmail({
            sender,
            recipients,
            subject: "New Email!",
            message: "We will follow up with a Paypal invoice soon!"
        })

        return Response.json({
            accepted: result.accepted,
        })
    } catch (error){
        return Response.json({message: 'Unable to send email at this time.'}, {status: 500})
    }
}