@imposium-hub/components 1.38.10 → 1.38.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imposium-hub/components",
3
- "version": "1.38.10",
3
+ "version": "1.38.11",
4
4
  "description": "React & Typescript component / asset library for Imposium front-ends",
5
5
  "main": "dist/components.js",
6
6
  "scripts": {
package/services/API.ts CHANGED
@@ -516,10 +516,23 @@ export default class API {
516
516
  });
517
517
  }
518
518
 
519
- public importBatchDataFromCsv = (batchId : string, csvFileKey : string) : Promise<any | Error> => {
519
+ public importBatchDataFromCsv = (
520
+ batchId : string,
521
+ csvFileKey : string,
522
+ embed : boolean = false,
523
+ accessKey : string = null,
524
+ compId : string = null) : Promise<any | Error> => {
525
+
520
526
  const formData : FormData = new FormData();
521
527
  formData.append('file_key', csvFileKey);
522
528
 
529
+ // used to generate the embed codes for an email batch
530
+ if (embed && accessKey && compId) {
531
+ formData.append('include_email_embed', 'true');
532
+ formData.append('composition_id', compId);
533
+ formData.append('access_key', accessKey);
534
+ }
535
+
523
536
  return this.doRequest({
524
537
  method: 'POST',
525
538
  url: `/batch/${batchId}/data/from-csv`,