Skip to content

Add initial status to drip destination #2884

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Object {
"testType": "XoS!vJs",
},
"email": "[email protected]",
"initial_status": "XoS!vJs",
"ip_address": "33.172.51.152",
"phone": "XoS!vJs",
"status": "XoS!vJs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Object {
"testType": "DVw6A7$UK[I",
},
"email": "[email protected]",
"initial_status": "DVw6A7$UK[I",
"ip_address": "100.102.165.77",
"phone": "DVw6A7$UK[I",
"status": "DVw6A7$UK[I",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ describe('Drip.identify', () => {
traits: {
email: '[email protected]',
phone: '1234567890',
initial_status: 'active',
status: 'unsubscribed',
status_updated_at: '2021-01-01T00:00:00Z',
custom_fields: {
Expand Down Expand Up @@ -57,6 +58,7 @@ describe('Drip.identify', () => {
email: '[email protected]',
ip_address: '127.0.0.1',
phone: '1234567890',
initial_status: 'active',
status: 'unsubscribed',
status_updated_at: '2021-01-01T00:00:00Z',
tags: ['tag1', 'tag2'],
Expand Down Expand Up @@ -90,7 +92,7 @@ describe('Drip.identify', () => {
{
email: '[email protected]',
ip_address: '8.8.8.8', // This could be wrong. Is this the IP address of the client, or segment?
status: 'unsubscribed',
initial_status: 'unsubscribed',
time_zone: 'Europe/Amsterdam'
}
]
Expand All @@ -112,6 +114,7 @@ describe('Drip.identify', () => {
traits: {
properties: {
email: '[email protected]',
initial_status: 'awaiting_confirmation',
status: 'active',
status_updated_at: '2023-01-01T00:00:00Z',
custom_fields: {
Expand All @@ -130,6 +133,9 @@ describe('Drip.identify', () => {
email: {
'@path': '$.traits.properties.email'
},
initial_status: {
'@path': '$.traits.properties.initial_status'
},
status: {
'@path': '$.traits.properties.status'
},
Expand Down Expand Up @@ -160,6 +166,7 @@ describe('Drip.identify', () => {
},
email: '[email protected]',
ip_address: '127.0.0.1',
initial_status: 'awaiting_confirmation',
status: 'active',
status_updated_at: '2023-01-01T00:00:00Z',
tags: ['vip', 'premium'],
Expand Down

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 @@ -15,6 +15,7 @@ const person = (payload: Payload) => {
email: payload.email,
ip_address: payload.ip,
phone: payload.phone,
initial_status: payload.initial_status,
status: payload.status,
status_updated_at: payload.status_updated_at,
tags: payload.tags?.split(',').map((tag) => tag.trim()),
Expand Down Expand Up @@ -57,19 +58,26 @@ const action: ActionDefinition<Settings, Payload> = {
type: 'string',
default: { '@path': '$.traits.phone' }
},
status: {
description: "The person's subscription status.",
label: 'Status',
initial_status: {
description: "The person's subscription status if newly identified.",
label: 'Initial Status',
required: false,
type: 'string',
default: {
'@if': {
exists: { '@path': '$.traits.status' },
then: { '@path': '$.traits.status' },
exists: { '@path': '$.traits.initial_status' },
then: { '@path': '$.traits.initial_status' },
else: 'unsubscribed'
}
}
},
status: {
description: "The person's subscription status. Overrides initial_status.",
label: 'Status',
required: false,
type: 'string',
default: { '@path': '$.traits.status' }
},
status_updated_at: {
description: "The timestamp associated with the update to a person's status.",
label: 'Status Updated At',
Expand Down
Loading