feat: user activation and emails

This commit is contained in:
Riccardo
2023-12-04 16:18:35 +01:00
parent 527fc25c08
commit 37f5692f61
40 changed files with 2093 additions and 310 deletions

24
utils/sender.ts Normal file
View File

@@ -0,0 +1,24 @@
import { Resend } from 'resend';
export async function sendEmail(
to: string[],
subject: string,
template: JSX.Element
) {
const resend = new Resend(process.env.RESEND_KEY);
try {
const { error } = await resend.emails.send({
from: process.env.RESEND_FROM!,
to,
subject,
react: template,
});
if (error) {
console.log(error);
}
} catch (error) {
console.log(error);
}
}