Repository navigation
feat: plan 029 — M6 win-back: Customer inactive trigger, daily sweep, trigger claims, 2 templates - #35
Merged
Conversation
…s per workflow and subject
…kflow is off before the run; log failed claim writes
…ck reads only its own orders
… a step ran; default from the catalog
…heck-winback covers batches, templates and preview
…cheduler's unique flag
…stop on an order during a Wait
…he window; v1.1 backlog item
…d, on every exit path
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A customer whose last real order is N days old now starts a workflow once for that order. A daily job finds them in batches. The library grows from 16 to 18 templates, with Win-back + discount and Win-back + free shipping.
Base:
develop8a94a41. Schema change: DB version 7 adds thetrigger_claimstable. One commit per checkpoint, plusfix:commits from review.Not verified on the posts order store.
check-winbackpassed on HPOS only: WooCommerce refused the switch because orders are out of sync on the dev site. See "Before merging".Checkpoints
trigger_claims(unique per workflow and subject),TriggerClaimStore, andRunRepository::claim_subject/release_subject.Trigger::claims_per_workflow(). The Dispatcher claims before it starts the run.CustomerInactive(subjectorder:<id>) andInactiveSweep: pages of 200, 2 minutes apart, over a 7-day window.inactive_sweep_job, with Schedule again.check-winbackcovers batches, templates end to end and preview. Decisions "M6. Win-back"; ROADMAP status and "Today" lines.Worth a closer look
Dispatcher::dispatchandWorker::release_claim.InactiveSweep::NOT_REAL). Pending, failed, cancelled and checkout draft don't count. On-hold and refunded do, so a customer with a newer on-hold order gets no "we miss you".InactiveSweep::batchcallsRuntime::dispatcher()->flush(), because a long Action Scheduler process has one shutdown for many batches.docs/workflow-core-decisions.md, section M6. One to weigh: activating a second win-back version emails every customer still in the window again: claims are per workflow. The v1.1 backlog has the fix.Before merging
./run.sh check-winbackon the posts store: sync orders, switch storage in WooCommerce → Settings → Advanced → Features, run it, switch back.How to test
./run.sh check-winback(about 2.5 minutes; it creates and removes 500 orders). It stops if the site has an active Customer inactive workflow.yaymatik_inactive_sweepand then theyaymatik_inactive_sweep_batchjob it queued from Scheduled Actions. The run shows "Order #N", Completed, 3 steps; the email arrives and the coupon works.