File tree Expand file tree Collapse file tree
supabase/functions/new_user Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,13 +36,13 @@ function sendToLoops(body: any) {
3636 } )
3737}
3838
39-
4039function createHubspotContact ( userData : {
4140 id : string
4241 email : string
4342 raw_user_meta_data ?: {
4443 full_name ?: string
4544 name ?: string
45+ is_fragments_user ?: boolean
4646 }
4747} ) {
4848 const name =
@@ -62,13 +62,19 @@ function createHubspotContact(userData: {
6262 }
6363 }
6464
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+
6570 // Map Supabase user data to HubSpot properties
6671 const hubspotContactData = {
6772 properties : {
68- db_user_id : userData . id ,
6973 email : userData . email ,
7074 firstname : firstName ,
7175 lastname : lastName ,
76+ db_user_id : userData . id ,
77+ db_is_fragments_user : isFragmentsUser ,
7278 } ,
7379 }
7480
You can’t perform that action at this time.
0 commit comments