Skip to content

Commit

Permalink
Merge pull request #743 from chaynHQ/develop
Browse files Browse the repository at this point in the history
Merge Develop onto Main
  • Loading branch information
annarhughes authored Jan 6, 2025
2 parents 889b4fc + df7c256 commit f708deb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/api/mailchimp/mailchimp-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,23 @@ export const batchCreateMailchimpProfiles = async (
operations.push({
method: 'POST',
path: `/lists/${mailchimpAudienceId}/members`,
operation_id: index,
operation_id: String(index),
body: JSON.stringify(userProfile),
});
});

const batchRequest = await mailchimp.batches.start({
operations: operations,
});
console.log('Mailchimp batch request:', batchRequest);
console.log('Wait 2 minutes before calling response...');
logger.log(`Mailchimp batch request: ${batchRequest}`);
logger.log('Wait 2 minutes before calling response...');

setTimeout(async () => {
const batchResponse = await mailchimp.batches.status(batchRequest.id);
console.log('Mailchimp batch response:', batchResponse);
logger.log(`Mailchimp batch response: ${batchResponse}`);
}, 120000);
} catch (error) {
throw new Error(`Batch create mailchimp profiles API call failed: ${error}`);
throw new Error(`Batch create mailchimp profiles API call failed: ${JSON.stringify(error)}`);
}
};

Expand Down

0 comments on commit f708deb

Please sign in to comment.