One-Click Digital Product Fulfillment
Overview
The digital catalog now has a one-click path from clean uploads to productized, fully automated fulfillment. The pipeline combines backend automation and a first-class operator UX:
- Workflow provisioning:
DigitalProductWorkflowProvisionerinstalls the default workflow (digital fulfillment → notification composer → Mailtrap sender) and links it to every draft created through the quick publish flow. - ExecModule upgrade:
DigitalDownloadNotificationModuleturns grantedDownloadAccessrows into email payloads, refreshing tokens viaDigitalFulfillmentService.refreshDownloadLinkso links are unique per customer. - UI panel: the File Record console surfaces a "One-Click Digital Product" card that promotes any clean upload directly into the catalog with a single submit.
Publishing Flow
- Upload a file and wait for the virus scan to reach CLEAN.
- Open Files → File Records. The new quick publish card appears above the grid.
- Pick the eligible upload, adjust name/price/limits, and submit.
- On success the panel echoes product metadata plus the attached workflow chain:
DigitalFulfillmentModuleDigitalDownloadNotificationModuleMailtrapSendModule
- When Stripe reports payment,
handlePaymentCompletedgrants access, launches the workflow, composes the email, and the Mailtrap module delivers the link.
Configuration Options
- Price: Numeric input; defaults to free. Stored as
Product.priceand surfaced in checkout. - Max downloads / Expiry: Optional numeric limits;
-1is treated as unlimited. - Notify before expiry:
DigitalAsset.notifyCustomerOnExpirytoggled for downstream reminder workflows.
Extending the Workflow
The provisioned workflow is just a starting point. Use Workflow Studio to append additional modules (CRM tagging, analytics, post-purchase surveys) and the quick publish flow will automatically inherit the updated sequence because every draft points to the same workflow ID.
Testing
DigitalProductWorkflowProvisionerTestverifies seeding + metadata snapshot.DigitalDownloadNotificationModuleTestcovers link refresh, email templating, and skip handling.DigitalProductQuickCreatePanel.test.tsxvalidates the UI empty state; additional integration tests can be layered using MSW.
Deploy to staging before rolling into production to confirm Stripe webhook + Mailtrap credentials in your environment.