Cross-cutting · Data export engine (email delivery)
The shared export path: a POST to
/api/v4/exportsnaming the model, the active filters, the filter combinator and the chosen columns, with the resulting file emailed to the requester rather than downloaded in the browser.
| Area | Cross-cutting |
| Routes | crm.users.index · crm.segments.index · crm.commerces.index · configuration.influence-zones.index · cms.categories.index · configuration.extra-attributes.index · configuration.centers.index · intranet.communications.show |
| Centre modules | always available |
| Staff levels | root · admin · manager · commerce |
| Models | — |
| UI label | informative-message.export-crm-csv.success.message |
| Coverage | 4 use cases · 1 happy · 4 failure |
Known issues (1)
- 🟠 Medium — Export spinner never clears on failure
How it works
Deliberately asynchronous — large exports do not block the UI and are not limited by the browser. The type key is pulled out of the filters and sent separately as filter-type (defaulting to and), and center-id is included so the API knows which centre the email is ‘from’. Every export tracks a DATA_EXPORTED analytics event with the entity, the filter count and the column count but not the filter values. Some screens bypass this and build a file in the browser instead (csv/xlsx services, e.g. intranet sales and the dashboard export), so there are two export idioms in the codebase with different failure characteristics.
Use cases
Why someone opens this (4)
- Exporting a large filtered customer set without timing out the browser.
- Handing a segment to an external mailing or analytics tool.
- Producing a reference-data extract for documentation or migration.
- Getting a recipient list with read/confirm status out of a communication.
Path map
flowchart LR F(["Data export engine email delivery"]):::feat F --> H1["Filtered export emailed"]:::ok F -.-> X1["Export request fails"]:::bad F -.-> X2["Email never arrives"]:::bad F -.-> X3["No columns selected"]:::bad F -.-> X4["Browser-side export fails"]:::bad classDef feat fill:#8c5a3c,stroke:#8c5a3c,color:#ffffff,font-weight:bold classDef ok fill:#e3f1ea,stroke:#0d6b42,color:#0d4a2e classDef bad fill:#f7e6e2,stroke:#9a2d1c,color:#6e1f13
Happy paths
Filtered export emailed
- User applies filters and selects the columns to include.
load.export(model, filters, columns)posts the job and tracks the analytics event.- The promise resolves and the success banner is shown.
- The file arrives by email, sent on behalf of the active centre.
Failure paths
Export request fails
Cause — API error on
/api/v4/exports.What happens —
load.exportreturns the parsed response but never rejects on a non-OK status, and most callers have no.catch()— so the loading flag can stay set and no error is shown. The weakest part of this otherwise sensible design.
Email never arrives
Cause — The job fails asynchronously, or the mail is blocked or filtered.
What happens — No job-status surface exists in the frontend; the user has already been told it succeeded.
No columns selected
Cause — User unticks everything in a column picker.
What happens — Not validated client-side — an empty
csv-fieldsarray is sent.
Browser-side export fails
Cause — The
csv/xlsxin-browser path errors on a large dataset.What happens — Depends on the caller; the intranet sales download at least validates its date range first.
QA checklist
Tick these off while regression-testing this feature. The boxes are plain Markdown, so progress is visible in git diffs.
- ✅ Filtered export emailed
- ⛔ Export request fails
- ⛔ Email never arrives
- ⛔ No columns selected
- ⛔ Browser-side export fails
Implementation
Translation keys (2)
Key English informative-message.export-crm-csv.success.messageThe export request has been processed successfully, you will receive an email with the exported file shortly segment.export-segmentExport segment users
Related
- Same area — CSV import engine · Filter & segment builder component · File upload, gallery & image modal · Multi-language content authoring · Realtime updates (Pusher) · Role & module permission layer · Error presentation & API error mapping · Product analytics & error monitoring
Generated from doc/feature-inventory.json · id xc-export-engine · commit 276788ca6