import { ok, badRequest, serverError } from "wix-http-functions"; import wixCrmBackend from "wix-crm-backend"; // CRM label keys — must match labels created in Wix CRM dashboard const CRM_LABELS = { base: "custom.lcg-lead", resilience: "custom.lcg-resilience", ai: "custom.lcg-ai-strategy", }; // LinkedIn URL helpers const liCompanyUrl = (slug) => slug ? `https://www.linkedin.com/company/${slug}` : ""; const liPersonUrl = (slug) => slug ? `https://www.linkedin.com/in/${slug}` : ""; // ───────────────────────────────────────────────────────────────────────────── // POST /_functions/lcgLead // // Expected JSON payload from Clay / Zapier: // { // company: string (required) // contactName: string // contactTitle: string // sector: string // size: "Small" | "Mid Cap" | "Large Cap" // hq: string // linkedinUrl: string (full contact profile URL) // liPersonSlug: string (e.g. "firstname-lastname") // liCompanySlug: string (e.g. "company-name") // email: string // phone: string // liSignals: string (comma-separated signal labels) // score: number (0–100) // focus: "resilience" | "ai" | "general" // notes: string // } // ───────────────────────────────────────────────────────────────────────────── export async function post_lcgLead(request) { let body; try { body = await request.body.json(); } catch (e) { return badRequest({ body: JSON.stringify({ error: "Invalid JSON body" }) }); } const { company, contactName, contactTitle, sector, size, hq, liPersonSlug, liCompanySlug, email, phone, liSignals, score, focus, notes } = body; if (!company) { return badRequest({ body: JSON.stringify({ error: "company is required" }) }); } // Build label list for CRM contact const labelKeys = [CRM_LABELS.base]; if (focus === "resilience") labelKeys.push(CRM_LABELS.resilience); if (focus === "ai") labelKeys.push(CRM_LABELS.ai); // Build extended fields const extendedFields = { "custom.lcg-company": company, "custom.lcg-title": contactTitle || "", "custom.lcg-sector": sector || "", "custom.lcg-size": size || "", "custom.lcg-hq": hq || "", "custom.lcg-li-person": liPersonUrl(liPersonSlug), "custom.lcg-li-company": liCompanyUrl(liCompanySlug), "custom.lcg-signals": liSignals || "", "custom.lcg-score": String(score || 0), "custom.lcg-focus": focus || "general", "custom.lcg-notes": notes || "", "custom.lcg-created": new Date().toISOString(), }; try { // Split name into first/last for CRM const nameParts = (contactName || company).trim().split(" "); const firstName = nameParts[0] || company; const lastName = nameParts.slice(1).join(" ") || ""; // Create or update contact in Wix CRM const contactInfo = { name: { first: firstName, last: lastName }, emails: email ? [{ email, tag: "MAIN" }] : [], phones: phone ? [{ phone, tag: "MAIN" }] : [], labelKeys, extendedFields, }; await wixCrmBackend.contacts.createContact(contactInfo); return ok({ body: JSON.stringify({ success: true, message: `Lead created: ${contactName || company}`, company, score: score || 0, }), }); } catch (err) { console.error("LCG CRM error:", err); return serverError({ body: JSON.stringify({ error: "CRM write failed", detail: err.message || String(err), }), }); } }
top of page

Invitation til eftermiddag med Leadership Capital Group – Vi vil gerne høre din mening!

tis 22 apr.

|

Charlottenlund

Invitation til eftermiddag med Leadership Capital Group, hvor vi gerne vil lære fra dig og din virksomhed hvordan vi bliver bedre til at rådgive SMV virksomheder

Tilmeldingen er lukket
Se andre events
Invitation til eftermiddag med Leadership Capital Group – Vi vil gerne høre din mening!
Invitation til eftermiddag med Leadership Capital Group – Vi vil gerne høre din mening!

Tid och plats

22 apr. 2025 17:00 – 19:00

Charlottenlund, Skovshoved Havn 16, 2920 Charlottenlund, Danmark

Gäster

Om evenemanget

Kære venner af Leadership Capital Group,


Vi håber, at alt står godt til hos jer!


Vi vil gerne invitere jer til et inspirerende eftermiddagsevent, hvor vi byder på lidt godt til ganen og i en mindre gruppe sammen udforsker, hvordan danske SMV’er kan få værdifuld sparring og støtte gennem et samarbejde med Leadership Capital Group.


Vores mål med arrangementet er at høre jeres tanker, erfaringer og behov, så vi kan få en endnu dybere forståelse af, hvordan vi bedst kan skabe værdi for vores kunder. Vi er et team af erfarne, tidligere ledere, der som konsulenter tilbyder kompetencebaseret rådgivning inden for områder som strategi, salg, markedsføring, HR, produktion, finans, kommunikation, krisestyring og teknologi – herunder AI.


Dette er ikke et salgsevent, men en unik mulighed for os at lære af spændende virksomheder som jeres. Vi ønsker at forstå, hvilke udfordringer og behov I står overfor, så vi kan skræddersy vores…


Google Maps blockerades på grund av dina inställningar för Analytics och funktionella cookies.

Dela detta evenemang

bottom of page