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 <[email protected]> * chore: wrapp up email sending --------- Co-authored-by: Rotimi Best <[email protected]>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user