diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 33ac365..0493f04 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -83,4 +83,6 @@ Avoid non-reactive variables; if a value affects the UI, use a rune. NEVER $: label syntax; use $state(), $derived(), and $effect(). If you want to use supabse client in the browser, it is stored in the data -variable obtained from let { data } = $props(); \ No newline at end of file +variable obtained from let { data } = $props(); + +Using `on:click` to listen to the click event is deprecated. Use the event attribute `onclick` instead \ No newline at end of file diff --git a/src/lib/google.ts b/src/lib/google.ts index 825d35d..792deb2 100644 --- a/src/lib/google.ts +++ b/src/lib/google.ts @@ -2,7 +2,10 @@ import { google } from 'googleapis'; import { env } from '$env/dynamic/private'; import quotedPrintable from 'quoted-printable'; // tiny, zero-dep package -export const scopes = ['https://www.googleapis.com/auth/gmail.send']; +export const scopes = [ + 'https://www.googleapis.com/auth/gmail.send', + 'https://www.googleapis.com/auth/userinfo.email' +]; export function getOAuthClient() { return new google.auth.OAuth2( @@ -61,11 +64,13 @@ export async function sendGmail( `; - const boundary = 'BOUNDARY'; const nl = '\r\n'; // RFC-5322 line ending - const htmlQP = quotedPrintable.encode(message_html); + // Convert HTML to a Buffer, then to latin1 string for quotedPrintable.encode + const htmlBuffer = Buffer.from(message_html, 'utf8'); + const htmlLatin1 = htmlBuffer.toString('latin1'); + const htmlQP = quotedPrintable.encode(htmlLatin1); const qrLines = qr_code.replace(/.{1,76}/g, '$&' + nl); const rawParts = [ diff --git a/src/routes/private/events/creator/finish/+page.svelte b/src/routes/private/events/creator/finish/+page.svelte index 42377c8..c940fab 100644 --- a/src/routes/private/events/creator/finish/+page.svelte +++ b/src/routes/private/events/creator/finish/+page.svelte @@ -1,9 +1,9 @@ + +
+

Creating event

+ {#if event_status === StepStatus.Waiting} + Waiting... + {:else if event_status === StepStatus.Loading} + Creating event... + {:else if event_status === StepStatus.Success} + Event created successfully. + {:else if event_status === StepStatus.Failure} + Failed to create event. + {/if} +
+

Creating database entries

- {#if supabase_status === StepStatus.Waiting} + {#if participants_status === StepStatus.Waiting} Waiting... - {:else if supabase_status === StepStatus.Loading} + {:else if participants_status === StepStatus.Loading} Creating entries... - {:else if supabase_status === StepStatus.Success} + {:else if participants_status === StepStatus.Success} Database entries created successfully. - {:else if supabase_status === StepStatus.Failure} + {:else if participants_status === StepStatus.Failure} Failed to create database entries. {/if}
@@ -114,12 +171,68 @@

Sending emails

{#if email_status === StepStatus.Waiting} - Waiting... - {:else if email_status === StepStatus.Loading} - Sending emails... - {:else if email_status === StepStatus.Success} - Emails sent successfully. - {:else if email_status === StepStatus.Failure} - Failed to send emails. +
+ Waiting... + +
+ {:else} + + {#if email_status === StepStatus.Loading} + Sending emails... + {:else if email_status === StepStatus.Success} + Emails sent successfully. + {:else if email_status === StepStatus.Failure} + Failed to send emails. + {/if} {/if}
diff --git a/src/routes/private/events/creator/steps/StepFinal.svelte b/src/routes/private/events/creator/steps/StepFinal.svelte deleted file mode 100644 index d81be7a..0000000 --- a/src/routes/private/events/creator/steps/StepFinal.svelte +++ /dev/null @@ -1,59 +0,0 @@ - - -Pl