File tree 1 file changed +8
-2
lines changed
supabase/functions/new_user
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -36,13 +36,13 @@ function sendToLoops(body: any) {
36
36
} )
37
37
}
38
38
39
-
40
39
function createHubspotContact ( userData : {
41
40
id : string
42
41
email : string
43
42
raw_user_meta_data ?: {
44
43
full_name ?: string
45
44
name ?: string
45
+ is_fragments_user ?: boolean
46
46
}
47
47
} ) {
48
48
const name =
@@ -62,13 +62,19 @@ function createHubspotContact(userData: {
62
62
}
63
63
}
64
64
65
+ // For HubSpot checkbox fields, we need to pass "true" or "false" as strings
66
+ const isFragmentsUser = userData . raw_user_meta_data ?. is_fragments_user
67
+ ? 'true'
68
+ : 'false'
69
+
65
70
// Map Supabase user data to HubSpot properties
66
71
const hubspotContactData = {
67
72
properties : {
68
- db_user_id : userData . id ,
69
73
email : userData . email ,
70
74
firstname : firstName ,
71
75
lastname : lastName ,
76
+ db_user_id : userData . id ,
77
+ db_is_fragments_user : isFragmentsUser ,
72
78
} ,
73
79
}
74
80
You can’t perform that action at this time.
0 commit comments