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

feat: add support for customerio source email subscribed event #3679

Merged
merged 1 commit into from
Aug 27, 2024
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
1 change: 1 addition & 0 deletions src/v0/sources/customerio/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const emailEventNameMap = {
spammed: 'Email Marked as Spam',
dropped: 'Email Dropped',
bounced: 'Email Bounced',
subscribed: 'Email Subscribed',
unsubscribed: 'Email Unsubscribed',
converted: 'Email Converted',
clicked: 'Email Link Clicked',
Expand Down
53 changes: 53 additions & 0 deletions test/integrations/sources/customerio/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1431,6 +1431,59 @@ export const data = [
},
},
},
{
name: 'customerio',
description: 'test-23: email subscribed',
module: 'source',
version: 'v0',
input: {
request: {
body: [
{
data: {
customer_id: '0200102',
identifiers: { id: '0200102' },
email_address: '[email protected]',
},
event_id: '01E4C4C6P79C12J5A6KPE6XNFD',
object_type: 'email',
metric: 'subscribed',
timestamp: 1585250179,
},
],
method: 'POST',
headers: { 'Content-Type': 'application/json' },
},
pathSuffix: '',
},
output: {
response: {
status: 200,
body: [
{
output: {
batch: [
{
context: {
library: { name: 'unknown', version: 'unknown' },
integration: { name: 'Customer.io' },
traits: { email: '[email protected]' },
},
integrations: { 'Customer.io': false },
type: 'track',
event: 'Email Subscribed',
properties: { eventId: '01E4C4C6P79C12J5A6KPE6XNFD' },
userId: '0200102',
originalTimestamp: '2020-03-26T19:16:19.000Z',
sentAt: '2020-03-26T19:16:19.000Z',
},
],
},
},
],
},
},
},
].map((tc) => ({
...tc,
mockFns: () => {
Expand Down
Loading