mirror of
https://github.com/n8n-io/n8n.git
synced 2026-06-03 02:07:06 +02:00
21 lines
548 B
TypeScript
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,
|
|
});
|
|
}
|