Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing default subscription to group for group call #995

Merged

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { convertAttributeTimestamps, convertValidTimestamp, trackApiEndpoint } f
const action: ActionDefinition<Settings, Payload> = {
title: 'Create or Update Object',
description: 'Create an object in Customer.io or update them if they exist.',
defaultSubscription: 'type = "object"',
defaultSubscription: 'type = "group"',
fields: {
id: {
label: 'Object ID',
Expand Down Expand Up @@ -53,13 +53,14 @@ const action: ActionDefinition<Settings, Payload> = {
'@path': '$.anonymousId'
}
},
type_id: {

object_type_id: {
label: 'Object Type Id',
description:
'The ID used to uniquely identify a custom object type in Customer.io. [Learn more](https://customer.io/docs/object-relationships).',
type: 'string',
default: {
'@path': '$.typeId'
'@path': '$.objectTypeId'
}
},
convert_timestamp: {
Expand All @@ -72,7 +73,7 @@ const action: ActionDefinition<Settings, Payload> = {
perform: (request, { settings, payload }) => {
let createdAt: string | number | undefined = payload.created_at
let customAttributes = payload.custom_attributes
const typeID = payload.type_id
const objectTypeID = payload.object_type_id
const userID = payload.user_id
const objectID = payload.id
const anonymousId = payload.anonymous_id
Expand All @@ -92,7 +93,7 @@ const action: ActionDefinition<Settings, Payload> = {
body.created_at = createdAt
}
body.type = 'object'
body.identifiers = { object_type_id: typeID ?? '1', object_id: objectID }
body.identifiers = { object_type_id: objectTypeID ?? '1', object_id: objectID }

if (userID) {
body.action = 'identify'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const action: ActionDefinition<Settings, Payload> = {
'The ID used to uniquely identify an object in Customer.io. [Learn more](https://customer.io/docs/object-relationships).',
type: 'string',
default: {
'@template': '{{context.groupId}}'
'@path': '$.context.groupId'
}
},
custom_attributes: {
Expand Down