Skip to content

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.

idle past the delaysigned link

Cart with items
and an email address

Reminder cron
(every 15 min)

Reminder email
with cart contents

Storefront /cart/recover

Cart restored

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.

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.
  1. Generate a random secret of at least 32 characters.
  2. In Stores > Configuration > Magenx > Abandoned Checkout Reminder > Email, set Recovery Link Secret to it.
  3. On the storefront, set MAGENX_ABANDONED_RECOVERY_SECRET to the same value.
  4. Set Storefront Recovery Path per store view if the locale is part of the URL, for example de/cart/recover.
  5. Set Storefront Unsubscribe Path and make sure that page really unsubscribes.
  6. 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.

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.

Send a reminder

  1. A scheduled job looks for abandoned carts in store views where reminders are on, oldest first, in bounded batches.
  2. 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.
  3. It checks the per-address cap, then renders the email in the cart's store view (language, currency, formatting) and sends it.
  4. On success it records one more sent reminder for the cart.

Guest returns

  1. The guest opens the link; the storefront removes the token from the address bar and exchanges it, server side, for the cart.
  2. If the browser already holds a cart with items, the shopper is asked before it is replaced.
  3. The restored cart is shown.

Customer returns

  1. A signed-in customer's link carries no token; signing in brings back their cart.

Send fails

  1. A failed send leaves the attempt claimed and the count unchanged.
  2. 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.
SituationWhat 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.
  • Guest carts once an email address has been entered; signed-in customers' carts.
  • Store views with reminders on.
  • 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.
Terminal window
composer require magenxcommerce/module-abandoned-checkout
bin/magento module:enable Magenx_AbandonedCheckout
bin/magento setup:upgrade
bin/magento setup:di:compile # production mode only
bin/magento cache:flush
  • PHP ~8.4.0||~8.5.0, Magento 2.4.8.

Stores > Configuration > Magenx > Abandoned Checkout Reminder

General

SettingDefaultScopeNotes
Enabled
magenx_abandoned_checkout/general/enabled
NoStore viewYes/No. Send abandoned-cart reminder emails on the cron schedule.
Delay Before First Reminder (minutes)
magenx_abandoned_checkout/general/delay_minutes
60Store viewText. Shown when Enabled = Yes. How long a cart must sit untouched before the first reminder.
Maximum Cart Age (hours)
magenx_abandoned_checkout/general/max_age_hours
168Store viewText. Shown when Enabled = Yes. Do not remind carts older than this — avoids chasing stale carts / dead addresses.
Maximum Reminders Per Cart
magenx_abandoned_checkout/general/max_reminders
1Store viewText. 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/general/repeat_interval_minutes
1440Store viewText. Shown when Enabled = Yes. Only used when Maximum Reminders is greater than 1.
Retry Backoff After a Failed Send (minutes)
magenx_abandoned_checkout/general/retry_backoff_minutes
60Store viewText. Shown when Enabled = Yes. How long to wait before re-attempting a cart whose last reminder failed to send.
Batch Size Per Cron Run
magenx_abandoned_checkout/general/batch_size
50Store viewText. Shown when Enabled = Yes. How many carts to process on each cron run.
Maximum Reminders Per Email Address
magenx_abandoned_checkout/general/max_reminders_per_email
3GlobalText. 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/general/per_email_window_days
30GlobalText. Shown when Enabled = Yes. How far back the per-address cap counts.
Minimum Cart Total
magenx_abandoned_checkout/general/min_subtotal
0Store viewText. Shown when Enabled = Yes. Skip carts whose grand total (base currency) is below this. 0 = no minimum.

Email

SettingDefaultScopeNotes
Email Template
magenx_abandoned_checkout/email/email_template
Module's default templateStore viewDropdown.
Email Sender
magenx_abandoned_checkout/email/sender_email_identity
Sales RepresentativeStore viewDropdown.
Storefront Recovery Path
magenx_abandoned_checkout/email/recovery_path
cart/recoverStore viewText. 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 Secret
magenx_abandoned_checkout/email/recovery_secret
emptyStore viewSecret. 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/email/token_ttl_hours
72Store viewText. 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 Path
magenx_abandoned_checkout/email/unsubscribe_path
emptyStore viewText. 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

SettingDefaultScopeNotes
Cron Schedule
magenx_abandoned_checkout/cron/schedule
*/15 * * * *GlobalText. Standard crontab expression (e.g. */15 * * * *).

Grant these under System > Permissions > User Roles > Role Resources:

ResourceUnderID
Abandoned Checkout Reminder SectionStores > Settings > ConfigurationMagenx_AbandonedCheckout::config
JobGroupDefault scheduleChange it at
magenx_abandoned_checkout_remindersdefault*/15 * * * *magenx_abandoned_checkout/cron/schedule
TermMeaning
Abandoned cartAn 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.
AttemptOne try to send a reminder for one cart.
ClaimReserving an attempt so that no other process sends it.
Reminder countReminders successfully sent for a cart.
Recovery linkLink in the reminder that restores the cart on the storefront.
Recovery tokenSigned value in a guest recovery link that names the cart and an expiry.
Cart access keyThe identifier that lets anyone holding it read and change a guest cart.
Per-address capMost reminders one email address may receive over a window, across all carts.
BackoffWaiting time before a failed attempt is retried.