18 lines
355 B
TypeScript
18 lines
355 B
TypeScript
import { Resend } from 'resend';
|
|
|
|
export function getMailClient() {
|
|
const apiKey = process.env.RESEND_API_KEY;
|
|
const fromEmail = process.env.RESEND_FROM_EMAIL;
|
|
const toEmail = process.env.RESEND_TO_EMAIL;
|
|
|
|
if (!apiKey || !fromEmail || !toEmail) {
|
|
return null;
|
|
}
|
|
|
|
return {
|
|
resend: new Resend(apiKey),
|
|
fromEmail,
|
|
toEmail,
|
|
};
|
|
}
|