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