Skip to content

Commit

Permalink
feat: add support for customerio source email subscribed event (#3679)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gauravudia authored Aug 27, 2024
1 parent f58d386 commit 4cb2799
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
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

0 comments on commit 4cb2799

Please sign in to comment.