hubspot issue (#27555)

This commit is contained in:
Anik Dhabal Babu
2026-02-03 14:03:35 +00:00
committed by GitHub
parent 629346060e
commit 5b1751c80b
3 changed files with 20 additions and 7 deletions
+11 -5
View File
@@ -560,12 +560,18 @@ class HubspotCalendarService implements CRM {
const simplePublicObjectInputs = contactsToCreate.map((attendee) => {
const [firstname, lastname] = attendee.name ? attendee.name.split(" ") : [attendee.email, ""];
const properties: Record<string, string> = {
firstname,
lastname,
email: attendee.email,
};
if (attendee.phone) {
properties.phone = attendee.phone;
}
return {
properties: {
firstname,
lastname,
email: attendee.email,
},
properties,
};
});
const createdContacts = await Promise.all(
+8 -2
View File
@@ -40,8 +40,14 @@ export default class CrmManager {
if (skipContactCreation) return;
const contactSet = new Set(contacts.map((c: { email: string }) => c.email));
// Figure out which contacts to create
const contactsToCreate = eventAttendees.filter((attendee) => !contactSet.has(attendee.email));
// Figure out which contacts to create and map phoneNumber to phone
const contactsToCreate: ContactCreateInput[] = eventAttendees
.filter((attendee) => !contactSet.has(attendee.email))
.map((attendee) => ({
email: attendee.email,
name: attendee.name,
phone: attendee.phoneNumber ?? undefined,
}));
const createdContacts = await this.createContacts(
contactsToCreate,
event.organizer?.email,
+1
View File
@@ -11,6 +11,7 @@ export interface CrmData {
export interface ContactCreateInput {
email: string;
name: string;
phone?: string | null;
}
export interface Contact {