eletrotupi / tcc/ api/src/lib/mail.ts76f9f78b530c2c8f2ba22ac9bb89a6f6417ca422
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
}