diff --git a/src/v0/sources/customerio/config.js b/src/v0/sources/customerio/config.js index f084f5e189..41257ed6de 100644 --- a/src/v0/sources/customerio/config.js +++ b/src/v0/sources/customerio/config.js @@ -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', diff --git a/test/integrations/sources/customerio/data.ts b/test/integrations/sources/customerio/data.ts index be2fc1a62e..b831b1d0b0 100644 --- a/test/integrations/sources/customerio/data.ts +++ b/test/integrations/sources/customerio/data.ts @@ -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: 'test@example.com', + }, + 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: 'test@example.com' }, + }, + 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: () => {