useSimpuFileUpload
hook handles recipient file uploads, including CSV and Excel file processing for campaign recipients.
onUploadFile(fileType: "csv" | "excel", file: File)
- Uploads a file and returns import data and columnsonUploadBlob(blob: Blob)
- Uploads a blob as a fileonProcessCSVFile(file: File)
- Processes CSV file and returns sample data (up to 500 rows of the file) for use when auto-detecting columnsonProcessExcelFile(file: File)
- Processes Excel file and returns sample data (up to 500 rows of the file) for use when auto-detecting columnsonFileUploadDropRejected({ files: File[] })
- Handles rejected file uploads, such as unsupported file types or size limitsuseImportMapping
hook manages column mapping for imported files, including auto-detection of column types and manual mapping configuration.
mappedProperties: PropertySchema[]
- Array of mapped propertiesautoDetectionLoading: boolean
- True when auto-detecting column typeshasSelectedEmailColumn: boolean
- True if an email column is selectedonMapColumns(importId: string, mapping: Record<string, PropertySchema>)
- Maps columns for importonPropertyUpdate(property: PropertySchema, index: number)
- Updates a propertyonAutoDetectColumns(dataSample?: any[])
- Auto-detects column types from sample data