feat: move all email to defer queue #185

fix: use relative part for defer func #185

chore: move sendEmail into defer

fix: remove anon function to defer #185

feat: implement batch email sending with defer.run #185

chore: debug sendEmails #185

chore: add robots.txt

chore: use promise.all in sendEmails

chore: debug defer sendEmails #185

chore: try defer sendEmail without loop #105

chore: comment code

chore: change loop style #185

chore: use promise.all for vercel edge #185

feat: add await to sendEmailNotification #185

chore: use sendEmails #185

fix: debug sendEmails #185

fix: email not updating in LMS

fix: remove early return in sendEmails #185
This commit is contained in:
Rotimi Best
2024-03-01 14:10:40 +01:00
parent 3a22a73380
commit ff524fca27
24 changed files with 239 additions and 120 deletions
@@ -1,6 +1,6 @@
import { json } from '@sveltejs/kit';
import { getSupabase } from '$lib/utils/functions/supabase';
import { sendEmail } from '$lib/utils/services/notification/send';
import sendEmail from '$defer/sendEmail';
const supabase = getSupabase();
@@ -25,7 +25,7 @@ export async function POST({ request }) {
return json({ success: false, message: 'Unauthenticated user' }, { status: 401 });
}
sendEmail({
await sendEmail({
to,
subject: 'Thank you so so so much for choosing ClassroomIO!',
content: `
@@ -48,7 +48,7 @@ export async function POST({ request }) {
</div>
`,
isPersonalEmail: true
}).then((info) => console.log('Email sent:', info));
});
return json({
success: true,