+
+ {/if}
+
+
+
diff --git a/src/routes/console/project-[project]/messaging/wizard/step3.svelte b/src/routes/console/project-[project]/messaging/wizard/step3.svelte
new file mode 100644
index 000000000..4a62c75ef
--- /dev/null
+++ b/src/routes/console/project-[project]/messaging/wizard/step3.svelte
@@ -0,0 +1,101 @@
+
+
+
+ Schedule
+
+ Schedule the time you want your users to receive this message. Learn more in our
+ documentation.
+
+
+
+
+
+
+
+
+ {#if when === 'now'}
+ The message will be sent immediately
+ {:else if !dateTime || isNaN(dateTime.getTime())}
+ The message will be sent later
+ {:else}
+ The message will be sent at {dateTime.toLocaleString('en', formatOptions)}
+ {/if}
+
+
+
+
diff --git a/src/routes/console/project-[project]/messaging/wizard/store.ts b/src/routes/console/project-[project]/messaging/wizard/store.ts
new file mode 100644
index 000000000..6ec774cc8
--- /dev/null
+++ b/src/routes/console/project-[project]/messaging/wizard/store.ts
@@ -0,0 +1,52 @@
+import { ProviderTypes } from '../providerType.svelte';
+import type { Target } from '../userTargetsModal.svelte';
+import { writable } from 'svelte/store';
+
+export enum MessageStatuses {
+ DRAFT = 'draft',
+ PROCESSING = 'processing'
+}
+
+export type MessageParams = {
+ messageId: string;
+ topics: string[];
+ users: string[];
+ targets: string[];
+ description: string;
+ status: MessageStatuses;
+ scheduledAt?: string;
+};
+
+export type EmailMessageParams = MessageParams & {
+ subject: string;
+ content: string;
+ html: boolean;
+};
+
+export type SMSMessageParams = MessageParams & {
+ content: string;
+};
+
+export type PushMessageParams = MessageParams & {
+ title: string;
+ body: string;
+ data: Record;
+ action?: string;
+ icon?: string;
+ sound?: string;
+ color?: string;
+ tag?: string;
+ badge?: string;
+};
+
+export const providerType = writable(null);
+export const targetsById = writable>({});
+export const messageParams = writable<{
+ [ProviderTypes.Email]: Partial;
+ [ProviderTypes.Sms]: Partial;
+ [ProviderTypes.Push]: Partial;
+}>({
+ [ProviderTypes.Email]: null,
+ [ProviderTypes.Sms]: null,
+ [ProviderTypes.Push]: null
+});