Fix mail sending

This commit is contained in:
Clément Pons
2025-04-22 09:28:48 +02:00
parent 7beeed8a61
commit 735dfb6980
5 changed files with 50 additions and 52 deletions

View File

@@ -2,6 +2,7 @@ import { hash } from "bun";
import { eq } from "drizzle-orm";
import useDatabase from "~/composables/useDatabase";
import { usersTable } from "~/db/schema";
import sendMail from '~/server/tasks/mail';
export default defineEventHandler(async (e) => {
const session = await getUserSession(e);
@@ -56,7 +57,7 @@ export default defineEventHandler(async (e) => {
id: emailId, timestamp,
}
});
await runTask('mail', {
await sendMail({
payload: {
type: 'mail',
to: [data.email],