Abandoned Checkout
Module: Magenx_AbandonedCheckout · no GraphQL changes
Emails a reminder to shoppers who leave items in their cart. The email lists the cart and has a one-click link that brings the cart back on the storefront.
How it works
Section titled “How it works”A cart gets a reminder when it:
- has items and an email address (guests give one at the email or shipping step);
- has been idle longer than Delay before first reminder, but not longer than Maximum cart age;
- reaches the Minimum cart total;
- has had fewer reminders than Maximum reminders per cart, spaced by the minimum interval.
Emails are rendered in the cart’s store view, with its language and number formats. A failed send is retried after Retry backoff. Two cron runs at the same time can’t send the same reminder twice.
Recovery links
Section titled “Recovery links”The link never contains the cart ID itself, which would let anyone holding it change the cart. It carries a signed token with an expiry instead (Recovery Link Lifetime, default 72 hours). The storefront checks the signature on its server before restoring the cart.
- Tokens can be opened more than once. Corporate mail scanners open links before the recipient does, and a one-time token would arrive already used.
- Signed-in customers’ links carry no token. They get their cart back by signing in.
- If the browser already holds a cart with items, the shopper is asked before it is replaced.
Set up
Section titled “Set up”- Generate a random secret of at least 32 characters.
- In Stores > Configuration > Magenx > Abandoned Checkout Reminder > Email, set Recovery Link Secret to it.
- On the storefront, set
MAGENX_ABANDONED_RECOVERY_SECRETto the same value. - Set Storefront Recovery Path per store view if the locale is part of the URL, for example
de/cart/recover. - Set Storefront Unsubscribe Path and make sure that page really unsubscribes.
- Turn on Enabled and adjust the timing rules.
Until both sides have the secret, guest reminders are not sent. Reminders for signed-in customers still go out, because their links carry no token.
Abuse limits
Section titled “Abuse limits”A guest’s email address on a cart is never verified, so anyone could create carts addressed to someone else. Max reminders per email address (default 3 in 30 days) caps what one address receives across all carts. Leave it on.
Delivery is at-least-once: in rare crashes a reminder can be sent twice.
User flows
Section titled “User flows”Send a reminder
- A scheduled job looks for abandoned carts in store views where reminders are on, oldest first, in bounded batches.
- For each cart it checks the store view's rules, claims the attempt, re-reads the cart and checks it is still active, still has items and still meets the minimum value.
- It checks the per-address cap, then renders the email in the cart's store view (language, currency, formatting) and sends it.
- On success it records one more sent reminder for the cart.
Guest returns
- The guest opens the link; the storefront removes the token from the address bar and exchanges it, server side, for the cart.
- If the browser already holds a cart with items, the shopper is asked before it is replaced.
- The restored cart is shown.
Customer returns
- A signed-in customer's link carries no token; signing in brings back their cart.
Send fails
- A failed send leaves the attempt claimed and the count unchanged.
- The cart is tried again after the backoff.
These always hold:
- At most one process sends a given attempt.
- A cart never receives more reminders than its limit.
- An address never receives more reminders than the cap within the window.
- A guest cart's access key never appears in an email.
- Reminder bookkeeping never resets the abandoned clock.
- A cart is due when: delay ≤ time since last change ≤ maximum age; reminders sent < limit; and no attempt yet, or time since last attempt ≥ backoff (if the last attempt failed) or ≥ interval (if it succeeded).
- Token expiry = now + min(link lifetime, maximum cart age).
- Address count = reminders sent to that address whose last attempt falls inside the window. Counting errs toward withholding.
- Delivery is at least once: a crash between sending and recording may resend once, after the backoff.
- A cart that cannot be sent never blocks the rest of the queue.
Edge cases
Section titled “Edge cases”| Situation | What happens |
|---|---|
| Two jobs pick the same batch. | Each cart is claimed once; no double send. |
| Cart becomes an order between detection and sending. | Skipped. |
| Ten guest carts carry the same address in one run. | No more than the cap are sent. |
| Token altered or expired. | The storefront refuses to restore. |
| Signing secret not set. | Guest carts deferred; customer carts sent. |
| Store view A uses a 30-minute delay, B 120 minutes. | Each store view's delay honoured. |
| Template rendering fails. | Attempt kept; retried after backoff; error logged. |
| Browser already holds a different cart with items. | Shopper asked before it is replaced. |
Who it applies to
Section titled “Who it applies to”- Guest carts once an email address has been entered; signed-in customers' carts.
- Store views with reminders on.
Out of scope
Section titled “Out of scope”- Discount codes inside reminders.
- Channels other than email (SMS, push).
- An unsubscribe and bounce-suppression system (the reminder can carry an unsubscribe link; honouring it is out of scope).
- Revenue attribution reporting.
- Template A/B testing.
Install
Section titled “Install”composer require magenxcommerce/module-abandoned-checkoutbin/magento module:enable Magenx_AbandonedCheckoutbin/magento setup:upgradebin/magento setup:di:compile # production mode onlybin/magento cache:flush- PHP
~8.4.0||~8.5.0, Magento 2.4.8.
Configuration
Section titled “Configuration”Stores > Configuration > Magenx > Abandoned Checkout Reminder
General
| Setting | Default | Scope | Notes |
|---|---|---|---|
Enabledmagenx_abandoned_checkout/ | No | Store view | Yes/No. Send abandoned-cart reminder emails on the cron schedule. |
Delay Before First Reminder (minutes)magenx_abandoned_checkout/ | 60 | Store view | Text. Shown when Enabled = Yes. How long a cart must sit untouched before the first reminder. |
Maximum Cart Age (hours)magenx_abandoned_checkout/ | 168 | Store view | Text. Shown when Enabled = Yes. Do not remind carts older than this — avoids chasing stale carts / dead addresses. |
Maximum Reminders Per Cartmagenx_abandoned_checkout/ | 1 | Store view | Text. Shown when Enabled = Yes. 1 = a single reminder. Higher values send follow-ups spaced by the repeat interval below. |
Minimum Interval Between Reminders (minutes)magenx_abandoned_checkout/ | 1440 | Store view | Text. Shown when Enabled = Yes. Only used when Maximum Reminders is greater than 1. |
Retry Backoff After a Failed Send (minutes)magenx_abandoned_checkout/ | 60 | Store view | Text. Shown when Enabled = Yes. How long to wait before re-attempting a cart whose last reminder failed to send. |
Batch Size Per Cron Runmagenx_abandoned_checkout/ | 50 | Store view | Text. Shown when Enabled = Yes. How many carts to process on each cron run. |
Maximum Reminders Per Email Addressmagenx_abandoned_checkout/ | 3 | Global | Text. Shown when Enabled = Yes. Across all carts in the window below. A cart's email address is never verified, so without this anyone can have your store mail an address repeatedly by creating carts for it. 0 disables the cap. Global on purpose — a per-store cap would just be spread across store views. |
Per-Address Cap Window (days)magenx_abandoned_checkout/ | 30 | Global | Text. Shown when Enabled = Yes. How far back the per-address cap counts. |
Minimum Cart Totalmagenx_abandoned_checkout/ | 0 | Store view | Text. Shown when Enabled = Yes. Skip carts whose grand total (base currency) is below this. 0 = no minimum. |
| Setting | Default | Scope | Notes |
|---|---|---|---|
Email Templatemagenx_abandoned_checkout/ | Module's default template | Store view | Dropdown. |
Email Sendermagenx_abandoned_checkout/ | Sales Representative | Store view | Dropdown. |
Storefront Recovery Pathmagenx_abandoned_checkout/ | cart/recover | Store view | Text. Path appended to the store base URL for the "return to cart" link. The masked cart id is added as ?id=.... Set per store view if your locale is part of the path (e.g. de/cart/recover). |
Recovery Link Secretmagenx_abandoned_checkout/ | empty | Store view | Secret. Shared secret used to sign recovery links. Must match the storefront's MAGENX_ABANDONED_RECOVERY_SECRET. Use at least 32 random characters. No reminders are sent until this is set. |
Recovery Link Lifetime (hours)magenx_abandoned_checkout/ | 72 | Store view | Text. How long a recovery link keeps working. Capped at Maximum Cart Age. Shorter is safer — the link restores the cart to whoever opens it. |
Storefront Unsubscribe Pathmagenx_abandoned_checkout/ | empty | Store view | Text. Path to your opt-out page; the recipient's address is added as ?email=.... Leave empty to render no unsubscribe link — but see the README: these are unsolicited commercial emails and most jurisdictions require an opt-out. |
Cron
| Setting | Default | Scope | Notes |
|---|---|---|---|
Cron Schedulemagenx_abandoned_checkout/ | */15 * * * * | Global | Text. Standard crontab expression (e.g. */15 * * * *). |
Admin permissions
Section titled “Admin permissions”Grant these under System > Permissions > User Roles > Role Resources:
| Resource | Under | ID |
|---|---|---|
| Abandoned Checkout Reminder Section | Stores > Settings > Configuration | Magenx_AbandonedCheckout::config |
| Job | Group | Default schedule | Change it at |
|---|---|---|---|
magenx_abandoned_checkout_reminders | default | */15 * * * * | magenx_abandoned_checkout/cron/schedule |
Glossary
Section titled “Glossary”| Term | Meaning |
|---|---|
| Abandoned cart | An active cart with items and an email address that has not been changed for at least the delay and is younger than the maximum age. |
| Attempt | One try to send a reminder for one cart. |
| Claim | Reserving an attempt so that no other process sends it. |
| Reminder count | Reminders successfully sent for a cart. |
| Recovery link | Link in the reminder that restores the cart on the storefront. |
| Recovery token | Signed value in a guest recovery link that names the cart and an expiry. |
| Cart access key | The identifier that lets anyone holding it read and change a guest cart. |
| Per-address cap | Most reminders one email address may receive over a window, across all carts. |
| Backoff | Waiting time before a failed attempt is retried. |