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