eletrotupi / tcc/ api/src/lib/mail.ts5d2d8805510eedeef6c368247dedf274a649742c
394 B | 12 lines Raw
1
import { Resend } from 'resend';
2

3
// Initialized once when the module is first imported
4
export const resend = new Resend(process.env.RESEND_API_KEY);
5

6
// XXX: Bleh, resend doesn't expose their types so w/e
7
export async function sendEmail(opts: any): Promise<any> {
8
  return await resend.emails.send({
9
    from: process.env.RESEND_FROM ?? 'naoresponda@updates.cabotia.dev',
10
    ...opts,
11
  });
12
}