File size: 422 Bytes
7e5cb25
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
export const sendEmail = async (body) => {
  if (!process.env.RESEND_KEY) {
    return console.warn("RESEND_KEY is not set, skipping email sending")
  }

  const res = await fetch("https://api.resend.com/emails", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      Authorization: `Bearer ${process.env.RESEND_KEY}`,
    },
    body: JSON.stringify(body),
  })

  return await res.json()
}