feat: remove defer (#243)

* working on moving the email logic to the backend

* Moved nodemailer to the backend

* uninstall defer

* updated relative import path in tsconfig

* working on the zod validation

* Merge branch 'main' into send-email

* fixed the zod import issue

* fixed the zod import issue

* updated the env example files

* docs: update README.md (#249)

* fix: handle catex error

* chore: remove fly.io github action

* Update README.md

Updated the Readme to reflect changes made to the emailing flow

---------

Co-authored-by: Rotimi Best <best@classroomio.com>

* chore: wrapp up email sending

---------

Co-authored-by: Rotimi Best <best@classroomio.com>
This commit is contained in:
Em_Dev
2024-04-12 04:57:19 +01:00
committed by GitHub
co-authored by Rotimi Best
parent 75ad73b97f
commit 3fe15e6633
27 changed files with 523 additions and 215 deletions
@@ -1,6 +1,6 @@
import { json } from '@sveltejs/kit';
import { getSupabase } from '$lib/utils/functions/supabase';
import sendEmail from '$defer/sendEmail';
import sendEmail from '$nodemailer/sendEmail';
const supabase = getSupabase();
@@ -25,10 +25,11 @@ export async function POST({ request }) {
return json({ success: false, message: 'Unauthenticated user' }, { status: 401 });
}
await sendEmail({
to,
subject: 'Thank you so so so much for choosing ClassroomIO!',
content: `
const emailData = [
{
to,
subject: 'Thank you so so so much for choosing ClassroomIO!',
content: `
<p>Dear ${name},</p>
<p>My name is Best the CEO of ClassroomIO and I will personally like to welcome to the vibrant community of ClassroomIO!</p>
<p>
@@ -47,8 +48,10 @@ export async function POST({ request }) {
<a href="https://app.classroomio.com">Go to Dashboard</a>
</div>
`,
isPersonalEmail: true
});
isPersonalEmail: true
}
];
await sendEmail(emailData);
return json({
success: true,