Move from sendgrid to nodemailer for emails
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import { render } from 'svelte-email';
|
||||
import { json } from '@sveltejs/kit';
|
||||
import WelcomeTemplate from './template.svelte';
|
||||
import { getSendgrid, SENDGRID_FROM } from '$lib/utils/services/sendgrid';
|
||||
import { getSupabase } from '$lib/utils/functions/supabase';
|
||||
|
||||
import { sendEmail } from '$lib/utils/services/notification/send';
|
||||
|
||||
const sendgrid = getSendgrid();
|
||||
const supabase = getSupabase();
|
||||
|
||||
@@ -28,19 +29,29 @@ export async function POST({ request }) {
|
||||
return json({ success: false, message: 'Unauthenticated user' }, { status: 401 });
|
||||
}
|
||||
|
||||
const options = {
|
||||
from: SENDGRID_FROM,
|
||||
await sendEmail({
|
||||
to,
|
||||
subject: 'Thank you so so so much for choosing ClassroomIO!',
|
||||
html: render({
|
||||
template: WelcomeTemplate,
|
||||
props: {
|
||||
name
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
sendgrid.send(options);
|
||||
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>
|
||||
We're thrilled to have you join us in shaping the future of education. Your decision to embark on
|
||||
this journey with us is deeply appreciated, and we're genuinely excited about the possibilities
|
||||
that lie ahead.
|
||||
</p>
|
||||
<p>
|
||||
Once again, welcome to the ClassroomIO family. We're here to help, to listen, and to celebrate
|
||||
your successes. Get ready to unlock a world of possibilities in education!
|
||||
</p>
|
||||
<p>
|
||||
If you have any question or face any issues just send me an email [email protected] 😃
|
||||
</p>
|
||||
<div>
|
||||
<a href="https://app.classroomio.com">Go to Dashboard</a>
|
||||
</div>
|
||||
`
|
||||
});
|
||||
|
||||
return json({
|
||||
success: true,
|
||||
|
||||
Reference in New Issue
Block a user