CLASSROOMIO-T-152: Add payment link + reload on org login

This commit is contained in:
Rotimi Best
2023-09-14 23:04:51 +01:00
parent 530ea721a2
commit bc7a5e1e4d
16 changed files with 133 additions and 91 deletions
@@ -1,7 +1,7 @@
import { render } from 'svelte-email';
import { json } from '@sveltejs/kit';
import WelcomeTemplate from './template.svelte';
import { getSendgrid, SENDGRID_FROM_NOTIFY } from '$lib/utils/services/sendgrid';
import { getSendgrid, SENDGRID_FROM_NOREPLY } from '$lib/utils/services/sendgrid';
import { getSupabase } from '$lib/utils/functions/supabase';
const sendgrid = getSendgrid();
@@ -30,7 +30,7 @@ export async function POST({ request }) {
}
const options = {
from: SENDGRID_FROM_NOTIFY,
from: SENDGRID_FROM_NOREPLY,
to,
subject: `[${orgName}] Welcome to Class`,
html: render({
@@ -1,7 +1,7 @@
import { render } from 'svelte-email';
import { json } from '@sveltejs/kit';
import WelcomeTemplate from './template.svelte';
import { getSendgrid, SENDGRID_FROM_NOTIFY } from '$lib/utils/services/sendgrid';
import { getSendgrid, SENDGRID_FROM_NOREPLY } from '$lib/utils/services/sendgrid';
import { getSupabase } from '$lib/utils/functions/supabase';
const sendgrid = getSendgrid();
@@ -29,7 +29,7 @@ export async function POST({ request }) {
}
const options = {
from: SENDGRID_FROM_NOTIFY,
from: SENDGRID_FROM_NOREPLY,
to,
subject: `[${courseName}] You've got a new student!`,
html: render({
@@ -1,7 +1,7 @@
import { render } from 'svelte-email';
import { json } from '@sveltejs/kit';
import WelcomeTemplate from './template.svelte';
import { getSendgrid, SENDGRID_FROM_NOTIFY } from '$lib/utils/services/sendgrid';
import { getSendgrid, SENDGRID_FROM_NOREPLY } from '$lib/utils/services/sendgrid';
import { getSupabase } from '$lib/utils/functions/supabase';
const sendgrid = getSendgrid();
@@ -32,7 +32,7 @@ export async function POST({ request }) {
const inviteLink = `${origin}/org/${orgSiteName}/courses`;
const options = {
from: SENDGRID_FROM_NOTIFY,
from: SENDGRID_FROM_NOREPLY,
to,
subject: `You have been invited to a course in ${orgName}!`,
html: render({
+2 -2
View File
@@ -1,7 +1,7 @@
import { render } from 'svelte-email';
import { json } from '@sveltejs/kit';
import TeacherInviteTemplate from './template.svelte';
import { getSendgrid, SENDGRID_FROM_NOTIFY } from '$lib/utils/services/sendgrid';
import { getSendgrid, SENDGRID_FROM_NOREPLY } from '$lib/utils/services/sendgrid';
import { getSupabase } from '$lib/utils/functions/supabase';
const sendgrid = getSendgrid();
@@ -47,7 +47,7 @@ export async function POST({ request }) {
console.log('inviteData', inviteData);
const options = {
from: SENDGRID_FROM_NOTIFY,
from: SENDGRID_FROM_NOREPLY,
to: email,
subject: `Join ${name} on ClassroomIO`,
html: render({
+7
View File
@@ -35,6 +35,13 @@
});
console.log('data', data);
if (error) throw error;
// reload page on org site cause for some reason the authlistener on +layout.svelte doesn't run
// on org site
if ($currentOrg.id && redirect) {
console.log('Forcing full page reload for auth listener');
window.location.reload();
}
} catch (error) {
submitError = error.error_description || error.message;
} finally {