Skip to main content

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: DigitalProductWorkflowProvisioner installs the default workflow (digital fulfillment → notification composer → Mailtrap sender) and links it to every draft created through the quick publish flow.
  • ExecModule upgrade: DigitalDownloadNotificationModule turns granted DownloadAccess rows into email payloads, refreshing tokens via DigitalFulfillmentService.refreshDownloadLink so 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

  1. Upload a file and wait for the virus scan to reach CLEAN.
  2. Open Files → File Records. The new quick publish card appears above the grid.
  3. Pick the eligible upload, adjust name/price/limits, and submit.
  4. On success the panel echoes product metadata plus the attached workflow chain:
    • DigitalFulfillmentModule
    • DigitalDownloadNotificationModule
    • MailtrapSendModule
  5. When Stripe reports payment, handlePaymentCompleted grants 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.price and surfaced in checkout.
  • Max downloads / Expiry: Optional numeric limits; -1 is treated as unlimited.
  • Notify before expiry: DigitalAsset.notifyCustomerOnExpiry toggled 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

  • DigitalProductWorkflowProvisionerTest verifies seeding + metadata snapshot.
  • DigitalDownloadNotificationModuleTest covers link refresh, email templating, and skip handling.
  • DigitalProductQuickCreatePanel.test.tsx validates 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.