n8n/packages/editor-ui/src/api/workflow-webhooks.ts
कारतोफ्फेलस्क्रिप्ट™ 9e92a5774e
refactor(core): Remove Onboarding call prompts (no-changelog) (#9933)
2024-07-04 13:51:26 +02:00

21 lines
548 B
TypeScript

import type { IUser } from '@/Interface';
import { post } from '@/utils/apiUtils';
const N8N_API_BASE_URL = 'https://api.n8n.io/api';
const CONTACT_EMAIL_SUBMISSION_ENDPOINT = '/accounts/onboarding';
export async function submitEmailOnSignup(
instanceId: string,
currentUser: IUser,
email: string | undefined,
agree: boolean,
): Promise<string> {
return await post(N8N_API_BASE_URL, CONTACT_EMAIL_SUBMISSION_ENDPOINT, {
instance_id: instanceId,
user_id: `${instanceId}#${currentUser.id}`,
email,
agree,
agree_updates: true,
});
}