🐛 Fix issue not sending the event in the correct property on Lemlist (#2198)

This commit is contained in:
Ricardo Espinoza
2021-09-15 04:28:48 -04:00
committed by GitHub
parent fd064b7816
commit 2e098c25ed
2 changed files with 29 additions and 29 deletions

View File

@@ -13,6 +13,10 @@ import {
OptionsWithUri,
} from 'request';
import {
capitalCase,
} from 'change-case';
/**
* Make an authenticated API request to Lemlist.
*/
@@ -87,3 +91,22 @@ export async function lemlistApiRequestAllItems(
);
return returnData;
}
export function getEvents() {
const events = [
'*',
'emailsBounced',
'emailsClicked',
'emailsFailed',
'emailsInterested',
'emailsNotInterested',
'emailsOpened',
'emailsReplied',
'emailsSendFailed',
'emailsSent',
'emailsUnsubscribed',
];
return events.map((event: string) => ({ name: (event === '*') ? '*' : capitalCase(event), value: event }));
}